﻿<%@ Page Title="Report Filters - Multimedia" Language="C#" MasterPageFile="~/Users/NewDesign.Master"
    AutoEventWireup="true" Inherits="MediaMonitor.Users.NewAll_newsalertPendingMultiMedia"
    CodeBehind="NewAll-newsalertPendingMultiMedia.aspx.cs" %>

<%--@ OutputCache Duration="3600" VaryByParam="none"--%>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Charting" Assembly="Telerik.Web.UI" %>
<asp:Content ID="Content1" ContentPlaceHolderID="Head" runat="Server">
    <style>
        .span3
        {
            min-height: 0px !important;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Body" runat="Server">
    <asp:HiddenField ID="hdnUserID" runat="server" ClientIDMode="Static" />
    <asp:HiddenField ID="hdnUserRole" runat="server" ClientIDMode="Static" />
    <asp:HiddenField ID="hdnUserName" runat="server" ClientIDMode="Static" />
    <script src="../js/general.js" type="text/javascript"></script>
    <script type="text/javascript">

        $(document).ready(function () {

            $('#aHideChart').click(function () {
                $("[id$='ChartAvenueReport']").hide();
                $('#aShowChart').show();
                $('#aHideChart').hide();
            });

            $('#aShowChart').click(function () {

                $("[id$='ChartAvenueReport']").show();
                $('#aHideChart').show();
                $('#aShowChart').hide();
            });
            $('#aHide').click(function () {

                $("[id$='RadChart1']").hide();
                $('#aShow').show();
                $('#aHide').hide();
            });

            $('#aShow').click(function () {

                $("[id$='RadChart1']").show();
                $('#aHide').show();
                $('#aShow').hide();
            });


        });

    </script>
    <iframe id="frmDownload" width="1 " height="1" frameborder="0"></iframe>
    <script type="text/javascript">

        function GetDownload(id, type) {

            var iframe = document.getElementById("frmDownload");

            iframe.src = "../sitefiles/NewsAlert.aspx?id=" + id + "&type=" + type;

        }

    </script>
    <div class="multimedia-page" runat="server" id="MainDiv">
        <div class="news-page">
            <div class="press-head">
                <h1 style="text-align: center;">
                    <asp:Image ID="imgHead" runat="server" />
                </h1>
                <div class="sort-date">
                    <asp:Button ID="btnExport" runat="server" Text="Export" OnClick="btnExport_Click" />
                    <h2>
                        Sort By: <span>
                            <asp:DropDownList ID="ddlSortNews" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlSortNews_SelectedIndexChanged"
                                Enabled="false">
                                <asp:ListItem Text="Media Type"></asp:ListItem>
                                <asp:ListItem Text="Title"></asp:ListItem>
                                <asp:ListItem Text="Chronological"></asp:ListItem>
                                <asp:ListItem Text="Most Recent"></asp:ListItem>
                            </asp:DropDownList>
                        </span>
                    </h2>
                </div>
            </div>
            <div class="news-content ">
                <table width="100%">
                    <tr>
                        <td>
                            <div class="press-content media-content">
                                <div class="span3 press-inn" id="PressAlreadyRead" runat="server" visible="false">
                                    <asp:HiddenField ID="HdnPressAlreadyRead" runat="server" ClientIDMode="Static" />
                                    <asp:Label ID="ltrPressAlreadyRead" runat="server" ClientIDMode="Static"></asp:Label>
                                </div>
                                <div class="span3 press-inn tv-inn" id="TVAlreadyRead" runat="server" visible="false">
                                    <asp:HiddenField ID="hdnTVAlreadyRead" runat="server" ClientIDMode="Static" />
                                    <asp:Label ID="ltrTVAlreadyRead" runat="server" ClientIDMode="Static"></asp:Label>
                                </div>
                                <div class="span3 press-inn radio-inn" id="RadioAlreadyRead" runat="server" visible="false">
                                    <asp:HiddenField ID="hdnRadioAlreadyRead" runat="server" ClientIDMode="Static" />
                                    <asp:Label ID="ltrRadioAlreadyRead" runat="server" ClientIDMode="Static"></asp:Label>
                                </div>
                                <div class="span3 press-inn internet-inn" id="InternetAlreadyRead" runat="server"
                                    visible="false">
                                    <asp:HiddenField ID="hdnInternetAlreadyRead" runat="server" ClientIDMode="Static" />
                                    <asp:Label ID="ltrInternetAlreadyRead" runat="server" ClientIDMode="Static"></asp:Label>
                                </div>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <div class="press-content media-content">
                                <div class="span3 press-inn" id="PressCurrent" runat="server" visible="false">
                                    <asp:HiddenField ID="hdnPressCurrent" runat="server" ClientIDMode="Static" />
                                    <a href="javascript:void(0);" title="Previous" style="float: right; padding: 8px 3px 8px 0px;"
                                        id="aPressAlreadyRead">
                                        <img src="../images/arrow-up.png" /></a> <a href="javascript:void(0);" title="Next"
                                            id="aPressNext" style="float: right; padding: 8px 3px 8px 0px;">
                                            <img src="../images/arrow-down.png" /></a>
                                    <asp:Label ID="ltrPressCurrent" runat="server" ClientIDMode="Static"></asp:Label>
                                </div>
                                <div class="span3 press-inn tv-inn" id="TVCurrent" runat="server" visible="false">
                                    <asp:HiddenField ID="hdnTVCurrent" runat="server" ClientIDMode="Static" />
                                    <a href="javascript:void(0);" title="Previous" style="float: right; padding: 8px 3px 8px 0px;"
                                        id="aTVAlreadyRead">
                                        <img src="../images/arrow-up.png" /></a> <a href="javascript:void(0);" title="Next"
                                            style="float: right; padding: 8px 3px 8px 0px;" id="aTVNext">
                                            <img src="../images/arrow-down.png" /></a>
                                    <asp:Label ID="ltrTVCurrent" runat="server" ClientIDMode="Static"></asp:Label>
                                </div>
                                <div class="span3 press-inn radio-inn" id="RadioCurrent" runat="server" visible="false">
                                    <asp:HiddenField ID="hdnRadioCurrent" runat="server" ClientIDMode="Static" />
                                    <a href="javascript:void(0);" title="Previous" style="float: right; padding: 8px 3px 8px 0px;"
                                        id="aRadioAlreadyRead">
                                        <img src="../images/arrow-up.png" />
                                    </a><a href="javascript:void(0);" title="Next" style="float: right; padding: 8px 3px 8px 0px;"
                                        id="aRadioNext">
                                        <img src="../images/arrow-down.png" /></a>
                                    <asp:Label ID="ltrRadioCurrent" runat="server" ClientIDMode="Static"></asp:Label>
                                </div>
                                <div class="span3 press-inn internet-inn" id="InternetCurrent" runat="server" visible="false">
                                    <asp:HiddenField ID="hdnInternetCurrent" runat="server" ClientIDMode="Static" />
                                    <a href="javascript:void(0);" title="Previous" style="float: right; padding: 8px 3px 8px 0px;"
                                        id="aInternetAlreadyRead">
                                        <img src="../images/arrow-up.png" /></a> <a href="javascript:void(0);" title="Next"
                                            style="float: right; padding: 8px 3px 8px 0px;" id="aInternetNext">
                                            <img src="../images/arrow-down.png" /></a>
                                    <asp:Label ID="ltrInternetCurrent" runat="server" ClientIDMode="Static"></asp:Label>
                                </div>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <div class="press-content media-content">
                                <div class="span3 press-inn" id="PressNext" runat="server" visible="false">
                                    <asp:HiddenField ID="hdnPressNext" runat="server" ClientIDMode="Static" />
                                    <asp:Label runat="server" ID="ltrPressNext" ClientIDMode="Static"></asp:Label>
                                </div>
                                <div class="span3 press-inn tv-inn" id="TVNext" runat="server" visible="false">
                                    <asp:HiddenField ID="hdnTVNext" runat="server" ClientIDMode="Static" />
                                    <asp:Label runat="server" ID="ltrTVNext" ClientIDMode="Static"></asp:Label>
                                </div>
                                <div class="span3 press-inn radio-inn" id="RadioNext" runat="server" visible="false">
                                    <asp:HiddenField ID="hdnRadioNext" runat="server" ClientIDMode="Static" />
                                    <asp:Label runat="server" ID="ltrRadioNext" ClientIDMode="Static"></asp:Label>
                                </div>
                                <div class="span3 press-inn internet-inn" id="InternetNext" runat="server" visible="false">
                                    <asp:HiddenField ID="hdnInternetNext" runat="server" ClientIDMode="Static" />
                                    <asp:Label runat="server" ID="ltrInternetNext" ClientIDMode="Static"></asp:Label>
                                </div>
                            </div>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
    </div>
    <div>
        <div style="float: left;">
            <a id="aHideChart" href="javascript:void(0)">Hide Chart</a>&nbsp;&nbsp;<a id="aShowChart"
                href="javascript:void(0)" style="display: none;">Show Chart</a>
            <telerik:RadChart ID="ChartAvenueReport" ChartTitle-TextBlock-Text="Calificación"
                runat="server" Height="250px" Width="400px">
                <PlotArea>
                    <YAxis MaxValue="80">
                    </YAxis>
                    <XAxis MaxValue="1">
                    </XAxis>
                </PlotArea>
                <Series>
                    <telerik:ChartSeries Name="series 1" ActiveRegionToolTip="Click here" DataLabelsColumn="NewsAlertSTATUS"
                        DataYColumn="VALUE">
                        <Appearance LegendDisplayMode="ItemLabels">
                        </Appearance>
                    </telerik:ChartSeries>
                </Series>
                <telerik:ChartTitle>
                    <TextBlock Text="Postback Events">
                    </TextBlock>
                </telerik:ChartTitle>
            </telerik:RadChart>
        </div>
        <div style="float: right;">
            <a id="aHide" href="javascript:void(0)">Hide Chart</a>&nbsp;&nbsp;<a id="aShow" href="javascript:void(0)"
                style="display: none;">Show Chart</a>
            <telerik:RadChart ID="RadChart1" ChartTitle-TextBlock-Text="Medios" runat="server"
                Height="250px" Width="400px">
                <PlotArea>
                    <YAxis MaxValue="80">
                    </YAxis>
                    <XAxis MaxValue="1">
                    </XAxis>
                </PlotArea>
                <Series>
                    <telerik:ChartSeries Name="series 1" ActiveRegionToolTip="Click here" DataLabelsColumn="NewsAlertCOUNT"
                        DataYColumn="VALUE">
                        <Appearance LegendDisplayMode="ItemLabels">
                        </Appearance>
                    </telerik:ChartSeries>
                </Series>
                <telerik:ChartTitle>
                    <TextBlock Text="Postback Events">
                    </TextBlock>
                </telerik:ChartTitle>
            </telerik:RadChart>
        </div>
    </div>
    <div id="toPopup">
        <div class="close">
        </div>
        <span class="ecs_tooltip">Press Esc to close <span class="arrow"></span></span>
        <div id="popup_content">
            <!--your content start-->
            <table width="100%" style="padding: 10px;">
                <tr>
                    <td>
                    </td>
                    <td align="right">
                        <asp:HiddenField ID="hdnID" runat="server" ClientIDMode="Static" />
                    </td>
                </tr>
                <tr>
                    <td>
                        Subject:
                    </td>
                    <td>
                        <asp:TextBox ID="txtSubject" Width="420px" runat="server" ClientIDMode="Static"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        Sent by:
                    </td>
                    <td>
                        <asp:TextBox ID="txtSentby" Width="200px" runat="server" ClientIDMode="static"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        Email Body:
                    </td>
                    <td>
                        <asp:TextBox ID="txtEmailBody" Width="420px" runat="server" TextMode="MultiLine"
                            ClientIDMode="Static"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        Please enter Email :
                    </td>
                    <td>
                        <asp:TextBox ID="txtSendEmail" runat="server" CssClass="autosuggest" ClientIDMode="Static"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        &nbsp;
                    </td>
                    <td>
                        <asp:Button ID="btnSearch1" ValidationGroup="send" CssClass="btn" Text="Send" runat="server"
                            OnClick="btnSearch_click" />
                    </td>
                </tr>
            </table>
        </div>
        <!--your content end-->
    </div>
    <div id="toPopup2">
        <div class="close2">
        </div>
        <span class="ecs_tooltip2">Press Esc to close <span class="arrow2"></span></span>
        <div id="popup_content2">
            <!--your content start-->
            <table width="100%" style="padding: 10px;">
                <tr>
                    <td>
                    </td>
                    <td align="right">
                        <asp:HiddenField ID="hdnComentID" runat="server" ClientIDMode="Static" />
                        <asp:HiddenField ID="hdncomentEditID" runat="server" Value="0" ClientIDMode="Static" />
                    </td>
                </tr>
                <tr>
                    <td>
                        Comment :
                    </td>
                    <td>
                        <asp:TextBox ID="txtComent" ClientIDMode="Static" runat="server" Width="300px" Rows="4"
                            ValidationGroup="cmt" TextMode="MultiLine"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        &nbsp;
                    </td>
                    <td>
                        <asp:Button ID="btnComment1" ValidationGroup="cmt" CssClass="btn" Text="Save" runat="server"
                            OnClick="btnComment_click" />
                    </td>
                </tr>
            </table>
            <div class="allcomments">
                <table width="100%" cellspacing="0" cellpadding="0" id="NamesGridView">
                </table>
            </div>
        </div>
        <!--your content end-->
    </div>
    <div id="topopup3">
        <div class="close3">
        </div>
        <span class="ecs_tooltip3">Press Esc to close <span class="arrow3"></span></span>
        <div id="popup_content3">
            <!--your content start-->
            <table width="100%" style="padding: 10px;">
                <tr>
                    <td>
                    </td>
                    <td align="right">
                        <asp:HiddenField ID="hdnShareVedioID" runat="server" ClientIDMode="Static" />
                        <asp:HiddenField ID="hdnSectionCode" runat="server" ClientIDMode="Static" />
                        <asp:HiddenField ID="hdnMediaTypeName" runat="server" ClientIDMode="Static" />
                        <asp:HiddenField ID="hdnImageAudioVideoName" runat="server" ClientIDMode="Static" />
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <table id="Table1">
                        </table>
                    </td>
                </tr>
                <tr>
                    <td>
                        Subject:
                    </td>
                    <td>
                        <asp:TextBox ID="txtShareSubject" runat="server" ClientIDMode="Static" Width="420px"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        Sent By:
                    </td>
                    <td>
                        <asp:TextBox ID="txtShareSentBy" runat="server" ClientIDMode="Static" Width="200px"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        Email Body:
                    </td>
                    <td>
                        <asp:TextBox ID="txtShareEmailBody" runat="server" ClientIDMode="Static" Width="420px"
                            TextMode="MultiLine"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        Enter an email :
                    </td>
                    <td>
                        <asp:TextBox ID="txtEmailForShareVideo" runat="server" Width="300px" ValidationGroup="shared"
                            TextMode="SingleLine" CssClass="auto" ClientIDMode="Static"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        &nbsp;
                    </td>
                    <td>
                        <asp:Button ID="imgbtnShareVideo1" CssClass="btn" ValidationGroup="shared" Text="Send"
                            runat="server" OnClick="imgbtnShareVideo1_click" />
                        <%-- <asp:ImageButton ID="imgbtnShareVideo" ValidationGroup="shared" runat="server" OnClick="imgbtnShareVideo_click"
                            SkinID="Save" />--%>
                    </td>
                </tr>
            </table>
        </div>
        <!--your content end-->
    </div>
    <div id="topopup4">
        <div class="close4">
        </div>
        <span class="ecs_tooltip4">Press Esc to close <span class="arrow4"></span></span>
        <div id="popup_content4">
            <!--your content start-->
            <div id="Div5" class="wrapper-content">
                <div class="container">
                    <div class="logol">
                        <a href="defaultNew.aspx?Code=Home">
                            <img src="../images/logo.png" /></a>
                    </div>
                    <div class="news-content ">
                        <div id="Div3" runat="server" visible="true" class="span3 press-inn internet-inn">
                            <h2>
                                <span id="lblMediaTypeName"></span>- <small><span id="lblRFDate"></span>
                                    <%-- <%# Convert.ToDateTime(Eval("RFDate")).ToString("d")%>--%></small></h2>
                            <div class="press-data">
                                <h5>
                                    <span id="lblTitle"></span>
                                </h5>
                                <div class="info">
                                    <p>
                                        <b>Fecha:</b> <span id="lblRFDate2"></span>
                                    </p>
                                    <p>
                                        <b>Medio:</b><span class="blue-color"> <span id="lblMediaName"></span></span>
                                    </p>
                                    <p>
                                        <b>Seccion:</b> <span><span id="lblSectionDescription"></span></span>
                                    </p>
                                </div>
                                <div class="press-detailmedia">
                                    <p>
                                        <span id="lblNews"></span>
                                    </p>
                                </div>
                            </div>
                            <div class="button-div">
                                <div class="button-div-text">
                                    <p>
                                        Calificacion:<span> <span id="lblCalification"></span></span>
                                    </p>
                                    <p>
                                        Importancia:<span> <span id="lblImportant"></span></span>
                                    </p>
                                </div>
                                <div class="button">
                                    <a href="#" class="minuse" title="Read More">
                                        <img src="../images/minus-icon.jpg">
                                    </a><a id="aShareNews" title="Share News" href="#" class="topopup" val=''>
                                        <img src="../images/icon1.jpg"></a> <a id="aComments" title="Comments" href="#" class="topopup2"
                                            val=''>
                                            <img id="AddImg" src="../images/chat-icon.jpg">
                                        </a><a id="aView" href="javascript:void(0);" val='' title="" imagename='' mediatypename=''
                                            sectioncode=''>
                                            <img src="../images/view-icon.jpg"></a> <a id="ashareVideo" href="#" class="topopup3"
                                                val='' sectioncode='' mediatypename='' imageaudiovideoname='' title="">
                                                <img alt="Share Vedio" src="../images/share-video.jpg" />
                                            </a><a id="aDownloadVideo" val="" mediatypecode="" title="download" href="javascript:void(0);">
                                                <img src="../images/download.jpg" /></a>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!--your content end-->
    </div>
     <div id="topopup5">
        <div class="close5">
        </div>
        <span class="ecs_tooltip5">Press Esc to close <span class="arrow5"></span></span>
   
                        <table width="60%" style="padding:20px">
                            <tr>
                                <td>
                                    CALIFICACION
                                </td>
                                <td>
                                    <asp:DropDownList runat="server" ID="ddlCALIFICACION" ClientIDMode="Static">
                                        <asp:ListItem Text="Positiva" Value="Positiva"></asp:ListItem>
                                        <asp:ListItem Text="Negativa" Value="Negativa"></asp:ListItem>
                                        <asp:ListItem Text="Neutra" Value="Neutra"></asp:ListItem>
                                    </asp:DropDownList>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Button runat="server" ID="btnCALIFICACIONSave" CssClass="btn" Text="SAVE"   OnClick="btnCALIFICACIONSave_click" />
                                </td>
                                <td>
                                    <asp:Button runat="server" ID="btnCALIFICACIONCancel" CssClass="btn" Text="Cancel" />
                                </td>
                            </tr>
                        </table>
                    
        <!--your content end-->
    </div>
      <div id="topopup6">
        <div class="close6">
        </div>
        <span class="ecs_tooltip6">Press Esc to close <span class="arrow6"></span></span>
   
                        <table width="60%" style="padding:20px;">
                            <tr>
                                <td>
                                    IMPORTANCIA
                                </td>
                                <td>
                                    <asp:DropDownList runat="server" ID="ddlIMPORTANCIA" ClientIDMode="Static">
                                        <asp:ListItem Text="1" Value="1"></asp:ListItem>
                                        <asp:ListItem Text="2" Value="2"></asp:ListItem>
                                        <asp:ListItem Text="3" Value="3"></asp:ListItem>
                                        <asp:ListItem Text="4" Value="4"></asp:ListItem>
                                        <asp:ListItem Text="5" Value="5"></asp:ListItem>
                                    </asp:DropDownList>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Button runat="server" ID="btnIMPORTANCIASave" CssClass="btn" Text="SAVE"   OnClick="btnIMPORTANCIASave_click" />
                                </td>
                                <td>
                                    <asp:Button runat="server" ID="btnIMPORTANCIACancel" CssClass="btn" Text="Cancel" />
                                </td>
                            </tr>
                        </table>
                    
        <!--your content end-->
    </div>


    <asp:HiddenField ID="hdnlblCalification" runat="server" ClientIDMode="Static" />
    <asp:HiddenField ID="hdnImportancia" runat="server" ClientIDMode="Static" />
    <script>
        var postTimePress = 0;
        $(document).ready(function () {

            $("#aPressNext").click(function () {

                var ID = $('#HdnPressAlreadyRead').val();
                var class1 = $(this).val();
                if (postTimePress == 0) {

                    ID = ID - 1;
                    postTimePress = 1;
                }

                var jsdata = '{ID:' + ID + ',"code":"Press","click":"N"}';
                $.ajax({

                    type: "POST",

                    url: "NewAll-newsalertPendingMultiMedia.aspx/getmultiScroll",

                    data: jsdata,

                    contentType: "application/json",
                    dataType: "json",
                    success: function (data) {
                        if (data.d.length < 2) {
                            $('#ltrPressNext').html("<h2>Press-<small></small></h2><div class='press-data'><h5></h5> <div class='info'></div></div>");
                            alert('No more news');

                        }
                        else {
                            for (var i = 0; i < data.d.length; i++) {
                                if (i == 0) {
                                    $('#HdnPressAlreadyRead').val(data.d[i].ID);
                                    $('#ltrPressAlreadyRead').html("<h2>Press - <small>" + data.d[i].RFDate + "</small></h2> <div class='press-data'><h5>" + data.d[i].Title + "</h5> <div class='info'><p><b>Fecha:</b> " + data.d[i].RFDate + "</p><p><b>Medio:</b><span class='blue-color'> " + data.d[i].MediaName + "</span></p></div></div>");
                                }
                                if (i == 1) {
                                    $('#ltrPressCurrent').html("<h2>Press- <small>" +
                                                       data.d[i].RFDate + "</small></h2>" +
                                                "<div class=\"press-data\">" +
                                                    "<h5><a class='topopup4' style='cursor:pointer' val='" + data.d[i].ID + "'>"
                                                    + data.d[i].Title + "</a></h5>" +
                                                    "<div class=\"info\">" +
                                                        "<p>" +
                                                            "<b>Fecha:</b>" +
                                                           data.d[i].RFDate + "</p>" +
                                                        "<p>" +
                                                            "<b>Medio:</b><span class=\"blue-color\">" +
                                                                 data.d[i].MediaName +
                                                            "</span>" +
                                                        "</p>" +
                                                        "<p>" +
                                                            "<b>Pagina:</b>" +
                                                             data.d[i].PageorHour + "</p>" +
                                                        "<p>" +
                                                            "<b>Seccion:</b> <span>" +
                                                                 data.d[i].SectionDescription + "</span></p>" +
                                                    "</div>" +
                                                    "<div class=\"press-detail\" id='IDPress-" + data.d[i].ID + "'>" +
                                                        "<p>" +
                                                            data.d[i].NewsSummary + "</p>" +
                                                    "</div>" +
                                                    "<div class=\"press-detail\" style=\"display: none;\" id='IDPressText-" + data.d[i].ID + "'>" +
                                                        "<p>" +
                                                             data.d[i].News + "</p>" +
                                                    "</div>" +
                                                "</div>" +
                                                "<div class=\"button-div\">" +
                                            "<div class=\"button-div-text\">" +
                                                        "<p>" +
                                                            "<a href=\"javascript:void(0);\"  class=\"topopup5\" val='" + data.d[i].ID + "'>Calificación:</a>" +
                                                             "<span id=\"spnCalificación-" + data.d[i].ID + "\"> <b " + color(data.d[i].Calification) + ">" +
                                                                 data.d[i].Calification + "</b></span>" +
                                                           

                                                            "</p>" +
                                                        "<p>" +
                                                             "<a href=\"javascript:void(0);\" class=\"topopup6\" val='" + data.d[i].ID + "'>Importancia:</a>" +
                                                              "<span id=\"spnImportancia-" + data.d[i].ID + "\"> " + data.d[i].Important + " </span>" +
                                                              
                                                              "</p>" +
                                                    "</div>" +
                                                    "<div class=\"button\">" +
                                                        "<a href=\"#\" val='" + data.d[i].ID + "' class=\"topopup4\" title=\"Read More\">" +
                                                            "<img src=\"../images/icon.jpg\">" +
                                                        "</a><a title=\"Share News\" href=\"#\" class=\"topopup\" val='" + data.d[i].ID + "' subject='" + data.d[i].Title + "' SentBy='" + $('#hdnUserID').val() + "'>" +
                                                            "<img src=\"../images/icon1.jpg\"></a> </a> <a title='Comments " + data.d[i].Totalrecord + "' href=\"#\" class=\"topopup2\"" +
                                                                "val='" + data.d[i].ID + "'>" +
                                                                "<img src='" + checkComment(data.d[i].Totalrecord) + "'>" +
                                                                "</a><a title=\"View\" href=\"javascript:void(0);\" onclick=\"PopupCenterWithScroll('../sitefiles/NewsAlertpress.aspx?ID=" + data.d[i].ID + "&t=s&file=" + data.d[i].ImageAudioVideoName + "', '_blank', 750, 700); \">" +
                                                                "<img src=\"../images/view-icon.jpg\"></a><a title=\"Share Image\" href=\"#\" class=\"topopup3\"" +
                                                                    "val='" + data.d[i].ID + "' sectioncode='" + data.d[i].SectionCode + "' mediatypename='" + data.d[i].MediaTypeName + "'" +
                                                                    "imageaudiovideoname=' " + data.d[i].ImageAudioVideoName + "' subject='" + data.d[i].Title + "' SentBy='" + $('#hdnUserID').val() + "'><img alt=\"Share Vedio\"" +
                                                                        "src=\"../images/share-video.jpg\" />" +
                                                                "</a> <a title=\"Download\" onclick='javascript:GetDownload(\"" + data.d[i].ID + "\", \"press\"); return false;' href=\"javascript:void(0);\"" +
                                        "style='display: " + data.d[i].MediaTypeCode + " == \"6\" ? \"inline\" : \"none\"  '>" +
                                       " <img " +
                                            "src=\"../images/download.jpg\" /></a>" +
                                                    "</div>" +
                                                "</div>");

                                }
                                if (i == 2) {


                                    $('#ltrPressNext').html("<h2>Press - <small>" + data.d[i].RFDate + "</small></h2> <div class='press-data'><h5>" + data.d[i].Title + "</h5> <div class='info'><p><b>Fecha:</b> " + data.d[i].RFDate + "</p><p><b>Medio:</b><span class='blue-color'> " + data.d[i].MediaName + "</span></p></div></div>");
                                }
                            }
                        }
                    }

                })
            });

        });
    </script>
    <script>
        $(document).ready(function () {
            $("#aPressAlreadyRead").click(function () {
                var ID = $('#HdnPressAlreadyRead').val();
                if (postTimePress == 1) {

                    ID = parseInt(ID) + 1;
                    postTimePress = 0;
                }


                var class1 = $(this).val();
                var jsdata = '{ID:' + ID + ',"code":"Press","click":"P"}';
                $.ajax({

                    type: "POST",

                    url: "NewAll-newsalertPendingMultiMedia.aspx/getmultiScroll",

                    data: jsdata,

                    contentType: "application/json",
                    dataType: "json",
                    success: function (data) {
                        if (data.d.length < 1) {
                            alert('No more news');
                        }
                        else {
                            if (postTimePress == 0) {

                                var jsdata1 = '{ID:' + $('#HdnPressAlreadyRead').val() + ',"mediaTypeName":"Press"}';

                                $.ajax({

                                    type: "POST",

                                    url: "NewAll-newsalertLastMultiMedia.aspx/News",

                                    data: jsdata1,

                                    contentType: "application/json",
                                    dataType: "json",
                                    success: function (data) {
                                        for (var i = 0; i < data.d.length; i++) {
                                            $('#ltrPressNext').html("<h2>Press - <small>" + data.d[i].RFDate + "</small></h2> <div class='press-data'><h5>" + data.d[i].Title + "</h5> <div class='info'><p><b>Fecha:</b> " + data.d[i].RFDate + "</p><p><b>Medio:</b><span class='blue-color'> " + data.d[i].MediaName + "</span></p></div></div>");
                                        }
                                    }
                                });
                            }
                            for (var i = 0; i < data.d.length; i++) {
                                if (data.d.length == 2) {

                                    postTimePress = 1;
                                    if (i == 1) {

                                        $('#HdnPressAlreadyRead').val(data.d[i].ID);
                                        $('#ltrPressAlreadyRead').html("<h2>Press - <small>" + data.d[i].RFDate + "</small></h2> <div class='press-data'><h5>" + data.d[i].Title + "</h5> <div class='info'><p><b>Fecha:</b> " + data.d[i].RFDate + "</p><p><b>Medio:</b><span class='blue-color'> " + data.d[i].MediaName + "</span></p></div></div>");
                                    }

                                    if (i == 0) {
                                        $('#ltrPressCurrent').html("<h2>Press- <small>" +
                                                       data.d[i].RFDate + "</small></h2>" +
                                                "<div class=\"press-data\">" +
                                                   "<h5><a class='topopup4' style='cursor:pointer' val='" + data.d[i].ID + "'>"
                                                    + data.d[i].Title + "</a></h5>" +
                                                    "<div class=\"info\">" +
                                                        "<p>" +
                                                            "<b>Fecha:</b>" +
                                                           data.d[i].RFDate + "</p>" +
                                                        "<p>" +
                                                            "<b>Medio:</b><span class=\"blue-color\">" +
                                                                 data.d[i].MediaName +
                                                            "</span>" +
                                                        "</p>" +
                                                        "<p>" +
                                                            "<b>Pagina:</b>" +
                                                             data.d[i].PageorHour + "</p>" +
                                                        "<p>" +
                                                            "<b>Seccion:</b> <span>" +
                                                                 data.d[i].SectionDescription + "</span></p>" +
                                                    "</div>" +
                                                    "<div class=\"press-detail\" id='IDPress-" + data.d[i].ID + "'>" +
                                                        "<p>" +
                                                            data.d[i].NewsSummary + "</p>" +
                                                    "</div>" +
                                                    "<div class=\"press-detail\" style=\"display: none;\" id='IDPressText-" + data.d[i].ID + "'>" +
                                                        "<p>" +
                                                             data.d[i].News + "</p>" +
                                                    "</div>" +
                                                "</div>" +
                                                "<div class=\"button-div\">" +
                                            "<div class=\"button-div-text\">" +
                                                        "<p>" +
                                                            "<a href=\"javascript:void(0);\"  class=\"topopup5\" val='" + data.d[i].ID + "'>Calificación:</a>" +
                                                             "<span id=\"spnCalificación-" + data.d[i].ID + "\"> <b " + color(data.d[i].Calification) + ">" +
                                                                 data.d[i].Calification + "</b></span>" +
                                                            

                                                            "</p>" +
                                                        "<p>" +
                                                             "<a href=\"javascript:void(0);\" class=\"topopup6\" val='" + data.d[i].ID + "'>Importancia:</a>" +
                                                              "<span id=\"spnImportancia-" + data.d[i].ID + "\"> " + data.d[i].Important + " </span>" +
                                                            
                                                              "</p>" +
                                                    "</div>" +
                                                    "<div class=\"button\">" +
                                                        "<a href=\"#\" val='" + data.d[i].ID + "' class=\"topopup4\" title=\"Read More\">" +
                                                            "<img src=\"../images/icon.jpg\">" +
                                                        "</a><a title=\"Share News\" href=\"#\" class=\"topopup\" val='" + data.d[i].ID + "' subject='" + data.d[i].Title + "' SentBy='" + $('#hdnUserID').val() + "'>" +
                                                            "<img src=\"../images/icon1.jpg\"></a> </a> <a title='Comments " + data.d[i].Totalrecord + "' href=\"#\" class=\"topopup2\"" +
                                                                "val='" + data.d[i].ID + "'>" +
                                                                "<img src='" + checkComment(data.d[i].Totalrecord) + "'>" +
                                                                "</a><a title=\"View\" href=\"javascript:void(0);\" onclick=\"PopupCenterWithScroll('../sitefiles/NewsAlertpress.aspx?ID=" + data.d[i].ID + "&t=s&file=" + data.d[i].ImageAudioVideoName + "', '_blank', 750, 700); \">" +
                                                                "<img src=\"../images/view-icon.jpg\"></a><a title=\"Share Image\" href=\"#\" class=\"topopup3\"" +
                                                                    "val='" + data.d[i].ID + "' sectioncode='" + data.d[i].SectionCode + "' mediatypename='" + data.d[i].MediaTypeName + "'" +
                                                                    "imageaudiovideoname=' " + data.d[i].ImageAudioVideoName + "' subject='" + data.d[i].Title + "' SentBy='" + $('#hdnUserID').val() + "'><img alt=\"Share Vedio\"" +
                                                                        "src=\"../images/share-video.jpg\" />" +
                                                                "</a> <a title=\"Download\" onclick='javascript:GetDownload(\"" + data.d[i].ID + "\", \"press\"); return false;' href=\"javascript:void(0);\"" +
                                        "style='display: " + data.d[i].MediaTypeCode + " == \"6\" ? \"inline\" : \"none\"  '>" +
                                       " <img " +
                                            "src=\"../images/download.jpg\" /></a>" +
                                                    "</div>" +
                                                "</div>");

                                    }
                                }
                                else if (data.d.length == 1) {

                                    $('#HdnPressAlreadyRead').val(data.d[i].ID);
                                    $('#ltrPressAlreadyRead').html("<h2>Press - <small></small></h2><div class='press-data'><h5></h5> <div class='info'></div></div>");
                                    $('#ltrPressCurrent').html("<h2>Press- <small>" +
                                                       data.d[i].RFDate + "</small></h2>" +
                                                "<div class=\"press-data\">" +
                                                    "<h5>" +
                                                        data.d[i].Title + "</h5>" +
                                                    "<div class=\"info\">" +
                                                        "<p>" +
                                                            "<b>Fecha:</b>" +
                                                           data.d[i].RFDate + "</p>" +
                                                        "<p>" +
                                                            "<b>Medio:</b><span class=\"blue-color\">" +
                                                                 data.d[i].MediaName +
                                                            "</span>" +
                                                        "</p>" +
                                                        "<p>" +
                                                            "<b>Pagina:</b>" +
                                                             data.d[i].PageorHour + "</p>" +
                                                        "<p>" +
                                                            "<b>Seccion:</b> <span>" +
                                                                 data.d[i].SectionDescription + "</span></p>" +
                                                    "</div>" +
                                                    "<div class=\"press-detail\" id='IDPress-" + data.d[i].ID + "'>" +
                                                        "<p>" +
                                                            data.d[i].NewsSummary + "</p>" +
                                                    "</div>" +
                                                    "<div class=\"press-detail\" style=\"display: none;\" id='IDPressText-" + data.d[i].ID + "'>" +
                                                        "<p>" +
                                                             data.d[i].News + "</p>" +
                                                    "</div>" +
                                                "</div>" +
                                                "<div class=\"button-div\">" +
                                            "<div class=\"button-div-text\">" +
                                                        "<p>" +
                                                            "<a href=\"javascript:void(0);\"  class=\"topopup5\" val='" + data.d[i].ID + "'>Calificación:</a>" +
                                                             "<span id=\"spnCalificación-" + data.d[i].ID + "\"> <b " + color(data.d[i].Calification) + ">" +
                                                                 data.d[i].Calification + "</b></span>" +
                                                            

                                                            "</p>" +
                                                        "<p>" +
                                                             "<a href=\"javascript:void(0);\" class=\"topopup6\" val='" + data.d[i].ID + "'>Importancia:</a>" +
                                                              "<span id=\"spnImportancia-" + data.d[i].ID + "\"> " + data.d[i].Important + " </span>" +
                                                             
                                                              "</p>" +
                                                    "</div>" +
                                                    "<div class=\"button\">" +
                                                        "<a href=\"#\" val='" + data.d[i].ID + "' class=\"topopup4\" title=\"Read More\">" +
                                                            "<img src=\"../images/icon.jpg\">" +
                                                        "</a><a title=\"Share News\" href=\"#\" class=\"topopup\" val='" + data.d[i].ID + "' subject='" + data.d[i].Title + "' SentBy='" + $('#hdnUserID').val() + "'>" +
                                                            "<img src=\"../images/icon1.jpg\"></a> </a> <a title='Comments " + data.d[i].Totalrecord + "' href=\"#\" class=\"topopup2\"" +
                                                                "val='" + data.d[i].ID + "'>" +
                                                                "<img src='" + checkComment(data.d[i].Totalrecord) + "'>" +
                                                                "</a><a title=\"View\" href=\"javascript:void(0);\" onclick=\"PopupCenterWithScroll('../sitefiles/NewsAlertpress.aspx?ID=" + data.d[i].ID + "&t=s&file=" + data.d[i].ImageAudioVideoName + "', '_blank', 750, 700); \">" +
                                                                "<img src=\"../images/view-icon.jpg\"></a><a title=\"Share Image\" href=\"#\" class=\"topopup3\"" +
                                                                    "val='" + data.d[i].ID + "' sectioncode='" + data.d[i].SectionCode + "' mediatypename='" + data.d[i].MediaTypeName + "'" +
                                                                    "imageaudiovideoname=' " + data.d[i].ImageAudioVideoName + "' subject='" + data.d[i].Title + "' SentBy='" + $('#hdnUserID').val() + "'><img alt=\"Share Vedio\"" +
                                                                        "src=\"../images/share-video.jpg\" />" +
                                                                "</a> <a title=\"Download\" onclick='javascript:GetDownload(\"" + data.d[i].ID + "\", \"press\"); return false;' href=\"javascript:void(0);\"" +
                                        "style='display: " + data.d[i].MediaTypeCode + " == \"6\" ? \"inline\" : \"none\"  '>" +
                                       " <img " +
                                            "src=\"../images/download.jpg\" /></a>" +
                                                    "</div>" +
                                                "</div>");
                                }
                                else {
                                    if (i == 0) {
                                        $('#HdnPressAlreadyRead').val(data.d[i].ID);
                                        $('#ltrPressAlreadyRead').html("<h2>Press - <small>" + data.d[i].RFDate + "</small></h2> <div class='press-data'><h5>" + data.d[i].Title + "</h5> <div class='info'><p><b>Fecha:</b> " + data.d[i].RFDate + "</p><p><b>Medio:</b><span class='blue-color'> " + data.d[i].MediaName + "</span></p></div></div>");
                                    }

                                    if (i == 1) {
                                        $('#ltrPressCurrent').html("<h2>Press- <small>" +
                                                       data.d[i].RFDate + "</small></h2>" +
                                                "<div class=\"press-data\">" +
                                                    "<h5>" +
                                                        data.d[i].Title + "</h5>" +
                                                    "<div class=\"info\">" +
                                                        "<p>" +
                                                            "<b>Fecha:</b>" +
                                                           data.d[i].RFDate + "</p>" +
                                                        "<p>" +
                                                            "<b>Medio:</b><span class=\"blue-color\">" +
                                                                 data.d[i].MediaName +
                                                            "</span>" +
                                                        "</p>" +
                                                        "<p>" +
                                                            "<b>Pagina:</b>" +
                                                             data.d[i].PageorHour + "</p>" +
                                                        "<p>" +
                                                            "<b>Seccion:</b> <span>" +
                                                                 data.d[i].SectionDescription + "</span></p>" +
                                                    "</div>" +
                                                    "<div class=\"press-detail\" id='IDPress-" + data.d[i].ID + "'>" +
                                                        "<p>" +
                                                            data.d[i].NewsSummary + "</p>" +
                                                    "</div>" +
                                                    "<div class=\"press-detail\" style=\"display: none;\" id='IDPressText-" + data.d[i].ID + "'>" +
                                                        "<p>" +
                                                             data.d[i].News + "</p>" +
                                                    "</div>" +
                                                "</div>" +
                                                "<div class=\"button-div\">" +
                                            "<div class=\"button-div-text\">" +
                                                        "<p>" +
                                                            "<a href=\"javascript:void(0);\"  class=\"topopup5\" val='" + data.d[i].ID + "'>Calificación:</a>" +
                                                             "<span id=\"spnCalificación-" + data.d[i].ID + "\"> <b " + color(data.d[i].Calification) + ">" +
                                                                 data.d[i].Calification + "</b></span>" +
                                                           
                                                            "</p>" +
                                                        "<p>" +
                                                             "<a href=\"javascript:void(0);\" class=\"topopup6\" val='" + data.d[i].ID + "'>Importancia:</a>" +
                                                              "<span id=\"spnImportancia-" + data.d[i].ID + "\"> " + data.d[i].Important + " </span>" +
                                                              
                                                              "</p>" +
                                                    "</div>" +
                                                    "<div class=\"button\">" +
                                                        "<a href=\"#\" val='" + data.d[i].ID + "' class=\"topopup4\" title=\"Read More\">" +
                                                            "<img src=\"../images/icon.jpg\">" +
                                                        "</a><a title=\"Share News\" href=\"#\" class=\"topopup\" val='" + data.d[i].ID + "' subject='" + data.d[i].Title + "' SentBy='" + $('#hdnUserID').val() + "'>" +
                                                            "<img src=\"../images/icon1.jpg\"></a> </a> <a title='Comments " + data.d[i].Totalrecord + "' href=\"#\" class=\"topopup2\"" +
                                                                "val='" + data.d[i].ID + "'>" +
                                                                "<img src='" + checkComment(data.d[i].Totalrecord) + "'>" +
                                                                "</a><a title=\"View\" href=\"javascript:void(0);\" onclick=\"PopupCenterWithScroll('../sitefiles/NewsAlertpress.aspx?ID=" + data.d[i].ID + "&t=s&file=" + data.d[i].ImageAudioVideoName + "', '_blank', 750, 700); \">" +
                                                                "<img src=\"../images/view-icon.jpg\"></a><a title=\"Share Image\" href=\"#\" class=\"topopup3\"" +
                                                                    "val='" + data.d[i].ID + "' sectioncode='" + data.d[i].SectionCode + "' mediatypename='" + data.d[i].MediaTypeName + "'" +
                                                                    "imageaudiovideoname=' " + data.d[i].ImageAudioVideoName + "' subject='" + data.d[i].Title + "' SentBy='" + $('#hdnUserID').val() + "'><img alt=\"Share Vedio\"" +
                                                                        "src=\"../images/share-video.jpg\" />" +
                                                                "</a> <a title=\"Download\" onclick='javascript:GetDownload(\"" + data.d[i].ID + "\", \"press\"); return false;' href=\"javascript:void(0);\"" +
                                        "style='display: " + data.d[i].MediaTypeCode + " == \"6\" ? \"inline\" : \"none\"  '>" +
                                       " <img " +
                                            "src=\"../images/download.jpg\" /></a>" +
                                                    "</div>" +
                                                "</div>");

                                    }
                                    if (i == 2) {


                                        $('#ltrPressNext').html("<h2>Press - <small>" + data.d[i].RFDate + "</small></h2> <div class='press-data'><h5>" + data.d[i].Title + "</h5> <div class='info'><p><b>Fecha:</b> " + data.d[i].RFDate + "</p><p><b>Medio:</b><span class='blue-color'> " + data.d[i].MediaName + "</span></p></div></div>");
                                    }
                                }
                            }
                        }
                    }
                })
            });

        });
    </script>
    <script>
        var postTimeTV = 0;
        $(document).ready(function () {
            $("#aTVNext").click(function () {

                var ID = $('#hdnTVAlreadyRead').val();
                var class1 = $(this).val();
                if (postTimeTV == 0) {

                    ID = ID - 1;
                    postTimeTV = 1;
                }
                var jsdata = '{ID:' + ID + ',"code":"TV","click":"N"}';
                $.ajax({

                    type: "POST",

                    url: "NewAll-newsalertPendingMultiMedia.aspx/getmultiScroll",

                    data: jsdata,

                    contentType: "application/json",
                    dataType: "json",
                    success: function (data) {
                        if (data.d.length < 2) {
                            $('#ltrTVNext').html("<h2>TV - <small></small></h2><div class='press-data'><h5></h5> <div class='info'></div></div>");
                            alert('No more news');

                        }
                        else {
                            for (var i = 0; i < data.d.length; i++) {
                                if (i == 0) {
                                    $('#hdnTVAlreadyRead').val(data.d[i].ID);
                                    $('#ltrTVAlreadyRead').html("<h2>TV - <small>" + data.d[i].RFDate + "</small></h2> <div class='press-data'><h5>" + data.d[i].Title + "</h5> <div class='info'><p><b>Fecha:</b> " + data.d[i].RFDate + "</p><p><b>Medio:</b><span class='blue-color'> " + data.d[i].MediaName + "</span></p></div></div>");
                                }
                                if (i == 1) {
                                    $('#ltrTVCurrent').html("<h2>TV- <small>" +
                                                       data.d[i].RFDate + "</small></h2>" +
                                                "<div class=\"press-data\">" +
                                                    "<h5><a class='topopup4' style='cursor:pointer' val='" + data.d[i].ID + "'>"
                                                    + data.d[i].Title + "</a></h5>" +
                                                    "<div class=\"info\">" +
                                                        "<p>" +
                                                            "<b>Fecha:</b>" +
                                                           data.d[i].RFDate + "</p>" +
                                                        "<p>" +
                                                            "<b>Medio:</b><span class=\"blue-color\">" +
                                                                 data.d[i].MediaName +
                                                            "</span>" +
                                                        "</p>" +
                                                        "<p>" +
                                                            "<b>Pagina:</b>" +
                                                             data.d[i].PageorHour + "</p>" +
                                                        "<p>" +
                                                            "<b>Seccion:</b> <span>" +
                                                                 data.d[i].SectionDescription + "</span></p>" +
                                                    "</div>" +
                                                    "<div class=\"press-detail\" id='IDPress-" + data.d[i].ID + "'>" +
                                                        "<p>" +
                                                            data.d[i].NewsSummary + "</p>" +
                                                    "</div>" +
                                                    "<div class=\"press-detail\" style=\"display: none;\" id='IDPressText-" + data.d[i].ID + "'>" +
                                                        "<p>" +
                                                             data.d[i].News + "</p>" +
                                                    "</div>" +
                                                "</div>" +
                                                "<div class=\"button-div\">" +
                                                    "<div class=\"button-div-text\">" +
                                                        "<p>" +
                                                            "<a href=\"javascript:void(0);\"  class=\"topopup5\" val='" + data.d[i].ID + "'>Calificación:</a>" +
                                                             "<span id=\"spnCalificación-" + data.d[i].ID + "\"> <b " + color(data.d[i].Calification) + ">" +
                                                                data.d[i].Calification + "</b></span>" +
                                                            

                                                            "</p>" +
                                                        "<p>" +
                                                             "<a href=\"javascript:void(0);\" class=\"topopup6\" val='" + data.d[i].ID + "'>Importancia:</a>" +
                                                             "<span id=\"spnImportancia-" + data.d[i].ID + "\"> " + data.d[i].Important + " </span>" +
                                                             
                                                               "</p>" +
                                                    "</div>" +
                                                    "<div class=\"button\">" +
                                                        "<a href=\"#\" val='" + data.d[i].ID + "' class=\"topopup4\" title=\"Read More\">" +
                                                            "<img src=\"../images/icon.jpg\">" +
                                                        "</a><a title=\"Share News\" href=\"#\" class=\"topopup\" val='" + data.d[i].ID + "' subject='" + data.d[i].Title + "' SentBy='" + $('#hdnUserID').val() + "'>" +
                                                            "<img src=\"../images/icon1.jpg\"></a> <a href=\"#\" class=\"topopup2\" val='" + data.d[i].ID + "'" +
                                                                "title='Comments " + data.d[i].Totalrecord + "'>" +
                                                               "<img src='" + checkComment(data.d[i].Totalrecord) + "'>" +
                                                            "</a>" +

                                                            "<a title=\"watch video\" href=\"javascript:void(0);\" onclick=\"PopupCenter('../sitefiles/NewsAlertvideo.aspx?SectionCode=" + data.d[i].SectionCode + "&t=f&ID=" + data.d[i].ID + "', '_blank', 350, 280); \"" +
                                                                "style='display: " + data.d[i].MediaTypeCode + " == \"1\" ? \"inline\" : \"none\"  %>'>" +
                                                                "<img src=\"../images/view-icon.jpg\">" +
                                                            "</a>" +



                                                            "<a title=\"Share Video\" href=\"#\" class=\"topopup3\" val='" + data.d[i].ID + "'" +
                                                                "sectioncode='" + data.d[i].SectionCode + "' mediatypename='" + data.d[i].MediaTypeName + "'" +
                                                                "imageaudiovideoname=' " + data.d[i].ImageAudioVideoName + "' subject='" + data.d[i].Title + "' SentBy='" + $('#hdnUserID').val() + "'>" +
                                                                "<img alt=\"Share Vedio\" src=\"../images/share-video.jpg\" />" +
                                                            "</a> <a title=\"Download\" onclick='javascript:GetDownload(\"" + data.d[i].ID + "\", \"tv\"); return false;' href=\"javascript:void(0);\"" +
                                        "style='display: " + data.d[i].MediaTypeCode + " == \"1\" ? \"inline\" : \"none\"  '>" +
                                        "<img " +
                                            "src=\"../images/download.jpg\" /></a>" +
                                                    "</div>" +
                                                "</div>");

                                }
                                if (i == 2) {


                                    $('#ltrTVNext').html("<h2>TV - <small>" + data.d[i].RFDate + "</small></h2> <div class='press-data'><h5>" + data.d[i].Title + "</h5> <div class='info'><p><b>Fecha:</b> " + data.d[i].RFDate + "</p><p><b>Medio:</b><span class='blue-color'> " + data.d[i].MediaName + "</span></p></div></div>");
                                }
                            }
                        }
                    }

                })
            });

        });
        function checkComment(val) {
            return (val > 0) ? "../images/chat-icon2.png" : "../images/chat-icon.jpg";

        }
        function color(val) {
            var color = "";
            if (val == "Positiva")
                color = "class='Positiva'";
            else if (val == "Neutra")
                color = "class='Neutra'";
            else if (val == "Negativa")
                color = "class='Negativa'";
            return color;
        }
    </script>
    <script>
        $(document).ready(function () {
            $("#aTVAlreadyRead").click(function () {

                var ID = $('#hdnTVAlreadyRead').val();
                var class1 = $(this).val();
                if (postTimeTV == 1) {

                    ID = parseInt(ID) + 1;
                    postTimeTV = 0;
                }
                var jsdata = '{ID:' + ID + ',"code":"TV","click":"P"}';
                $.ajax({

                    type: "POST",

                    url: "NewAll-newsalertPendingMultiMedia.aspx/getmultiScroll",

                    data: jsdata,

                    contentType: "application/json",
                    dataType: "json",
                    success: function (data) {
                        if (data.d.length < 1) {
                            alert('No more news');
                        }
                        else {
                            if (postTimeTV == 0) {

                                var jsdata1 = '{ID:' + $('#hdnTVAlreadyRead').val() + ',"mediaTypeName":"TV"}';

                                $.ajax({

                                    type: "POST",

                                    url: "NewAll-newsalertLastMultiMedia.aspx/News",

                                    data: jsdata1,

                                    contentType: "application/json",
                                    dataType: "json",
                                    success: function (data) {
                                        for (var i = 0; i < data.d.length; i++) {
                                            $('#ltrTVNext').html("<h2>TV - <small>" + data.d[i].RFDate + "</small></h2> <div class='press-data'><h5>" + data.d[i].Title + "</h5> <div class='info'><p><b>Fecha:</b> " + data.d[i].RFDate + "</p><p><b>Medio:</b><span class='blue-color'> " + data.d[i].MediaName + "</span></p></div></div>");
                                        }
                                    }
                                });
                            }
                            for (var i = 0; i < data.d.length; i++) {
                                if (data.d.length == 2) {

                                    postTimeTV = 1;
                                    if (i == 1) {
                                        $('#hdnTVAlreadyRead').val(data.d[i].ID);
                                        $('#ltrTVAlreadyRead').html("<h2>TV - <small>" + data.d[i].RFDate + "</small></h2> <div class='press-data'><h5>" + data.d[i].Title + "</h5> <div class='info'><p><b>Fecha:</b> " + data.d[i].RFDate + "</p><p><b>Medio:</b><span class='blue-color'> " + data.d[i].MediaName + "</span></p></div></div>");
                                    }
                                    if (i == 0) {
                                        $('#ltrTVCurrent').html("<h2>TV- <small>" +
                                                       data.d[i].RFDate + "</small></h2>" +
                                                "<div class=\"press-data\">" +
                                                   "<h5><a class='topopup4' style='cursor:pointer' val='" + data.d[i].ID + "'>"
                                                    + data.d[i].Title + "</a></h5>" +
                                                    "<div class=\"info\">" +
                                                        "<p>" +
                                                            "<b>Fecha:</b>" +
                                                           data.d[i].RFDate + "</p>" +
                                                        "<p>" +
                                                            "<b>Medio:</b><span class=\"blue-color\">" +
                                                                 data.d[i].MediaName +
                                                            "</span>" +
                                                        "</p>" +
                                                        "<p>" +
                                                            "<b>Pagina:</b>" +
                                                             data.d[i].PageorHour + "</p>" +
                                                        "<p>" +
                                                            "<b>Seccion:</b> <span>" +
                                                                 data.d[i].SectionDescription + "</span></p>" +
                                                    "</div>" +
                                                    "<div class=\"press-detail\" id='IDPress-" + data.d[i].ID + "'>" +
                                                        "<p>" +
                                                            data.d[i].NewsSummary + "</p>" +
                                                    "</div>" +
                                                    "<div class=\"press-detail\" style=\"display: none;\" id='IDPressText-" + data.d[i].ID + "'>" +
                                                        "<p>" +
                                                             data.d[i].News + "</p>" +
                                                    "</div>" +
                                                "</div>" +
                                                "<div class=\"button-div\">" +
                                                    "<div class=\"button-div-text\">" +
                                                        "<p>" +
                                                            "<a href=\"javascript:void(0);\"  class=\"topopup5\" val='" + data.d[i].ID + "'>Calificación:</a>" +
                                                             "<span id=\"spnCalificación-" + data.d[i].ID + "\"> <b " + color(data.d[i].Calification) + ">" +
                                                                data.d[i].Calification + "</b></span>" +
                                                           

                                                            "</p>" +
                                                        "<p>" +
                                                             "<a href=\"javascript:void(0);\" class=\"topopup6\" val='" + data.d[i].ID + "'>Importancia:</a>" +
                                                             

                                                               "</p>" +
                                                    "</div>" +
                                                    "<div class=\"button\">" +
                                                        "<a href=\"#\" val='" + data.d[i].ID + "' class=\"topopup4\" title=\"Read More\">" +
                                                            "<img src=\"../images/icon.jpg\">" +
                                                        "</a><a title=\"Share News\" href=\"#\" class=\"topopup\" val='" + data.d[i].ID + "' subject='" + data.d[i].Title + "' SentBy='" + $('#hdnUserID').val() + "'>" +
                                                            "<img src=\"../images/icon1.jpg\"></a> <a href=\"#\" class=\"topopup2\" val='" + data.d[i].ID + "'" +
                                                                "title='Comments " + data.d[i].Totalrecord + "'>" +
                                                               "<img src='" + checkComment(data.d[i].Totalrecord) + "'>" +
                                                            "</a>" +

                                                            "<a title=\"watch video\" href=\"javascript:void(0);\" onclick=\"PopupCenter('../sitefiles/NewsAlertvideo.aspx?SectionCode=" + data.d[i].SectionCode + "&t=f&ID=" + data.d[i].ID + "', '_blank', 350, 280); \"" +
                                                                "style='display: " + data.d[i].MediaTypeCode + " == \"1\" ? \"inline\" : \"none\"  %>'>" +
                                                                "<img src=\"../images/view-icon.jpg\">" +
                                                            "</a>" +



                                                            "<a title=\"Share Video\" href=\"#\" class=\"topopup3\" val='" + data.d[i].ID + "'" +
                                                                "sectioncode='" + data.d[i].SectionCode + "' mediatypename='" + data.d[i].MediaTypeName + "'" +
                                                                "imageaudiovideoname=' " + data.d[i].ImageAudioVideoName + "' subject='" + data.d[i].Title + "' SentBy='" + $('#hdnUserID').val() + "'>" +
                                                                "<img alt=\"Share Vedio\" src=\"../images/share-video.jpg\" />" +
                                                            "</a> <a title=\"Download\" onclick='javascript:GetDownload(\"" + data.d[i].ID + "\", \"tv\"); return false;' href=\"javascript:void(0);\"" +
                                        "style='display: " + data.d[i].MediaTypeCode + " == \"1\" ? \"inline\" : \"none\"  '>" +
                                        "<img " +
                                            "src=\"../images/download.jpg\" /></a>" +
                                                    "</div>" +
                                                "</div>");

                                    }
                                }
                                else if (data.d.length == 1) {
                                    $('#hdnTVAlreadyRead').val(data.d[i].ID);
                                    $('#ltrTVAlreadyRead').html("<h2>TV - <small></small></h2><div class='press-data'><h5></h5> <div class='info'></div></div>");
                                    $('#ltrTVCurrent').html("<h2>TV- <small>" +
                                                       data.d[i].RFDate + "</small></h2>" +
                                                "<div class=\"press-data\">" +
                                                    "<h5>" +
                                                        data.d[i].Title + "</h5>" +
                                                    "<div class=\"info\">" +
                                                        "<p>" +
                                                            "<b>Fecha:</b>" +
                                                           data.d[i].RFDate + "</p>" +
                                                        "<p>" +
                                                            "<b>Medio:</b><span class=\"blue-color\">" +
                                                                 data.d[i].MediaName +
                                                            "</span>" +
                                                        "</p>" +
                                                        "<p>" +
                                                            "<b>Pagina:</b>" +
                                                             data.d[i].PageorHour + "</p>" +
                                                        "<p>" +
                                                            "<b>Seccion:</b> <span>" +
                                                                 data.d[i].SectionDescription + "</span></p>" +
                                                    "</div>" +
                                                    "<div class=\"press-detail\" id='IDPress-" + data.d[i].ID + "'>" +
                                                        "<p>" +
                                                            data.d[i].NewsSummary + "</p>" +
                                                    "</div>" +
                                                    "<div class=\"press-detail\" style=\"display: none;\" id='IDPressText-" + data.d[i].ID + "'>" +
                                                        "<p>" +
                                                             data.d[i].News + "</p>" +
                                                    "</div>" +
                                                "</div>" +
                                                "<div class=\"button-div\">" +
                                                    "<div class=\"button-div-text\">" +
                                                        "<p>" +
                                                            "<a href=\"javascript:void(0);\"  class=\"topopup5\" val='" + data.d[i].ID + "'>Calificación:</a>" +
                                                             "<span id=\"spnCalificación-" + data.d[i].ID + "\"> <b " + color(data.d[i].Calification) + ">" +
                                                                data.d[i].Calification + "</b></span>" +
                                                           
                                                            "</p>" +
                                                        "<p>" +
                                                             "<a href=\"javascript:void(0);\" class=\"topopup6\" val='" + data.d[i].ID + "'>Importancia:</a>" +
                                                             "<span id=\"spnImportancia-" + data.d[i].ID + "\"> " + data.d[i].Important + " </span>" +
                                                             

                                                               "</p>" +
                                                    "</div>" +
                                                    "<div class=\"button\">" +
                                                        "<a href=\"#\" val='" + data.d[i].ID + "' class=\"topopup4\" title=\"Read More\">" +
                                                            "<img src=\"../images/icon.jpg\">" +
                                                        "</a><a title=\"Share News\" href=\"#\" class=\"topopup\" val='" + data.d[i].ID + "' subject='" + data.d[i].Title + "' SentBy='" + $('#hdnUserID').val() + "'>" +
                                                            "<img src=\"../images/icon1.jpg\"></a> <a href=\"#\" class=\"topopup2\" val='" + data.d[i].ID + "'" +
                                                                "title='Comments " + data.d[i].Totalrecord + "'>" +
                                                               "<img src='" + checkComment(data.d[i].Totalrecord) + "'>" +
                                                            "</a>" +

                                                            "<a title=\"watch video\" href=\"javascript:void(0);\" onclick=\"PopupCenter('../sitefiles/NewsAlertvideo.aspx?SectionCode=" + data.d[i].SectionCode + "&t=f&ID=" + data.d[i].ID + "', '_blank', 350, 280); \"" +
                                                                "style='display: " + data.d[i].MediaTypeCode + " == \"1\" ? \"inline\" : \"none\"  %>'>" +
                                                                "<img src=\"../images/view-icon.jpg\">" +
                                                            "</a>" +



                                                            "<a title=\"Share Video\" href=\"#\" class=\"topopup3\" val='" + data.d[i].ID + "'" +
                                                                "sectioncode='" + data.d[i].SectionCode + "' mediatypename='" + data.d[i].MediaTypeName + "'" +
                                                                "imageaudiovideoname=' " + data.d[i].ImageAudioVideoName + "' subject='" + data.d[i].Title + "' SentBy='" + $('#hdnUserID').val() + "'>" +
                                                                "<img alt=\"Share Vedio\" src=\"../images/share-video.jpg\" />" +
                                                            "</a> <a title=\"Download\" onclick='javascript:GetDownload(\"" + data.d[i].ID + "\", \"tv\"); return false;' href=\"javascript:void(0);\"" +
                                        "style='display: " + data.d[i].MediaTypeCode + " == \"1\" ? \"inline\" : \"none\"  '>" +
                                        "<img " +
                                            "src=\"../images/download.jpg\" /></a>" +
                                                    "</div>" +
                                                "</div>");
                                }
                                else {
                                    if (i == 0) {
                                        $('#hdnTVAlreadyRead').val(data.d[i].ID);
                                        $('#ltrTVAlreadyRead').html("<h2>TV - <small>" + data.d[i].RFDate + "</small></h2> <div class='press-data'><h5>" + data.d[i].Title + "</h5> <div class='info'><p><b>Fecha:</b> " + data.d[i].RFDate + "</p><p><b>Medio:</b><span class='blue-color'> " + data.d[i].MediaName + "</span></p></div></div>");
                                    }
                                    if (i == 1) {
                                        $('#ltrTVCurrent').html("<h2>TV- <small>" +
                                                       data.d[i].RFDate + "</small></h2>" +
                                                "<div class=\"press-data\">" +
                                                    "<h5>" +
                                                        data.d[i].Title + "</h5>" +
                                                    "<div class=\"info\">" +
                                                        "<p>" +
                                                            "<b>Fecha:</b>" +
                                                           data.d[i].RFDate + "</p>" +
                                                        "<p>" +
                                                            "<b>Medio:</b><span class=\"blue-color\">" +
                                                                 data.d[i].MediaName +
                                                            "</span>" +
                                                        "</p>" +
                                                        "<p>" +
                                                            "<b>Pagina:</b>" +
                                                             data.d[i].PageorHour + "</p>" +
                                                        "<p>" +
                                                            "<b>Seccion:</b> <span>" +
                                                                 data.d[i].SectionDescription + "</span></p>" +
                                                    "</div>" +
                                                    "<div class=\"press-detail\" id='IDPress-" + data.d[i].ID + "'>" +
                                                        "<p>" +
                                                            data.d[i].NewsSummary + "</p>" +
                                                    "</div>" +
                                                    "<div class=\"press-detail\" style=\"display: none;\" id='IDPressText-" + data.d[i].ID + "'>" +
                                                        "<p>" +
                                                             data.d[i].News + "</p>" +
                                                    "</div>" +
                                                "</div>" +
                                                "<div class=\"button-div\">" +
                                                    "<div class=\"button-div-text\">" +
                                                        "<p>" +
                                                            "<a href=\"javascript:void(0);\"  class=\"topopup5\" val='" + data.d[i].ID + "'>Calificación:</a>" +
                                                             "<span id=\"spnCalificación-" + data.d[i].ID + "\"> <b " + color(data.d[i].Calification) + ">" +
                                                                data.d[i].Calification + "</b></span>" +
                                                           

                                                            "</p>" +
                                                        "<p>" +
                                                             "<a href=\"javascript:void(0);\" class=\"topopup6\" val='" + data.d[i].ID + "'>Importancia:</a>" +
                                                             "<span id=\"spnImportancia-" + data.d[i].ID + "\"> " + data.d[i].Important + " </span>" +
                                                             
                                                               "</p>" +
                                                    "</div>" +
                                                    "<div class=\"button\">" +
                                                        "<a href=\"#\" val='" + data.d[i].ID + "' class=\"topopup4\" title=\"Read More\">" +
                                                            "<img src=\"../images/icon.jpg\">" +
                                                        "</a><a title=\"Share News\" href=\"#\" class=\"topopup\" val='" + data.d[i].ID + "' subject='" + data.d[i].Title + "' SentBy='" + $('#hdnUserID').val() + "'>" +
                                                            "<img src=\"../images/icon1.jpg\"></a> <a href=\"#\" class=\"topopup2\" val='" + data.d[i].ID + "'" +
                                                                "title='Comments " + data.d[i].Totalrecord + "'>" +
                                                               "<img src='" + checkComment(data.d[i].Totalrecord) + "'>" +
                                                            "</a>" +

                                                            "<a title=\"watch video\" href=\"javascript:void(0);\" onclick=\"PopupCenter('../sitefiles/NewsAlertvideo.aspx?SectionCode=" + data.d[i].SectionCode + "&t=f&ID=" + data.d[i].ID + "', '_blank', 350, 280); \"" +
                                                                "style='display: " + data.d[i].MediaTypeCode + " == \"1\" ? \"inline\" : \"none\"  %>'>" +
                                                                "<img src=\"../images/view-icon.jpg\">" +
                                                            "</a>" +



                                                            "<a title=\"Share Video\" href=\"#\" class=\"topopup3\" val='" + data.d[i].ID + "'" +
                                                                "sectioncode='" + data.d[i].SectionCode + "' mediatypename='" + data.d[i].MediaTypeName + "'" +
                                                                "imageaudiovideoname=' " + data.d[i].ImageAudioVideoName + "' subject='" + data.d[i].Title + "' SentBy='" + $('#hdnUserID').val() + "'>" +
                                                                "<img alt=\"Share Vedio\" src=\"../images/share-video.jpg\" />" +
                                                            "</a> <a title=\"Download\" onclick='javascript:GetDownload(\"" + data.d[i].ID + "\", \"tv\"); return false;' href=\"javascript:void(0);\"" +
                                        "style='display: " + data.d[i].MediaTypeCode + " == \"1\" ? \"inline\" : \"none\"  '>" +
                                        "<img " +
                                            "src=\"../images/download.jpg\" /></a>" +
                                                    "</div>" +
                                                "</div>");

                                    }
                                    if (i == 2) {


                                        $('#ltrTVNext').html("<h2>TV - <small>" + data.d[i].RFDate + "</small></h2> <div class='press-data'><h5>" + data.d[i].Title + "</h5> <div class='info'><p><b>Fecha:</b> " + data.d[i].RFDate + "</p><p><b>Medio:</b><span class='blue-color'> " + data.d[i].MediaName + "</span></p></div></div>");
                                    }
                                }
                            }
                        }
                    }
                })
            });

        });
        function checkComment(val) {
            return (val > 0) ? "../images/chat-icon2.png" : "../images/chat-icon.jpg";

        }
        function color(val) {
            var color = "";
            if (val == "Positiva")
                color = "class='Positiva'";
            else if (val == "Neutra")
                color = "class='Neutra'";
            else if (val == "Negativa")
                color = "class='Negativa'";
            return color;
        }
    </script>
    <script>
        var postTimeRadio = 0;
        $(document).ready(function () {
            $("#aRadioNext").click(function () {

                var ID = $('#hdnRadioAlreadyRead').val();
                var class1 = $(this).val();
                if (postTimeRadio == 0) {

                    ID = ID - 1;
                    postTimeRadio = 1;
                }
                var jsdata = '{ID:' + ID + ',"code":"Radio","click":"N"}';
                $.ajax({

                    type: "POST",

                    url: "NewAll-newsalertPendingMultiMedia.aspx/getmultiScroll",

                    data: jsdata,

                    contentType: "application/json",
                    dataType: "json",
                    success: function (data) {
                        if (data.d.length < 2) {
                            $('#ltrRadioNext').html("<h2>Radio-<small></small></h2><div class='press-data'><h5></h5> <div class='info'></div></div>");
                            alert('No more news');

                        }
                        else {
                            if (postTimeRadio == 0) {

                                var jsdata1 = '{ID:' + $('#hdnRadioAlreadyRead').val() + ',"mediaTypeName":"Radio"}';

                                $.ajax({

                                    type: "POST",

                                    url: "NewAll-newsalertLastMultiMedia.aspx/News",

                                    data: jsdata1,

                                    contentType: "application/json",
                                    dataType: "json",
                                    success: function (data) {
                                        for (var i = 0; i < data.d.length; i++) {
                                            $('#ltrRadioNext').html("<h2>Radio - <small>" + data.d[i].RFDate + "</small></h2> <div class='press-data'><h5>" + data.d[i].Title + "</h5> <div class='info'><p><b>Fecha:</b> " + data.d[i].RFDate + "</p><p><b>Medio:</b><span class='blue-color'> " + data.d[i].MediaName + "</span></p></div></div>");
                                        }
                                    }
                                });
                            }
                            for (var i = 0; i < data.d.length; i++) {
                                if (i == 0) {
                                    $('#hdnRadioAlreadyRead').val(data.d[i].ID);
                                    $('#ltrRadioAlreadyRead').html("<h2>Radio - <small>" + data.d[i].RFDate + "</small></h2> <div class='press-data'><h5>" + data.d[i].Title + "</h5> <div class='info'><p><b>Fecha:</b> " + data.d[i].RFDate + "</p><p><b>Medio:</b><span class='blue-color'> " + data.d[i].MediaName + "</span></p></div></div>");
                                }
                                if (i == 1) {
                                    $('#ltrRadioCurrent').html("<h2>Radio- <small>" +
                                                       data.d[i].RFDate + "</small></h2>" +
                                                "<div class=\"press-data\">" +
                                                    "<h5><a class='topopup4' style='cursor:pointer' val='" + data.d[i].ID + "'>"
                                                    + data.d[i].Title + "</a></h5>" +
                                                    "<div class=\"info\">" +
                                                        "<p>" +
                                                            "<b>Fecha:</b>" +
                                                           data.d[i].RFDate + "</p>" +
                                                        "<p>" +
                                                            "<b>Medio:</b><span class=\"blue-color\">" +
                                                                 data.d[i].MediaName +
                                                            "</span>" +
                                                        "</p>" +
                                                        "<p>" +
                                                            "<b>Pagina:</b>" +
                                                             data.d[i].PageorHour + "</p>" +
                                                        "<p>" +
                                                            "<b>Seccion:</b> <span>" +
                                                                 data.d[i].SectionDescription + "</span></p>" +
                                                    "</div>" +
                                                    "<div class=\"press-detail\" id='IDPress-" + data.d[i].ID + "'>" +
                                                        "<p>" +
                                                            data.d[i].NewsSummary + "</p>" +
                                                    "</div>" +
                                                    "<div class=\"press-detail\" style=\"display: none;\" id='IDPressText-" + data.d[i].ID + "'>" +
                                                        "<p>" +
                                                             data.d[i].News + "</p>" +
                                                    "</div>" +
                                                "</div>" +
                                                "<div class=\"button-div\">" +
                                                   "<div class=\"button-div-text\">" +
                                                         "<p>" +
                                                             "<a href=\"javascript:void(0);\"  class=\"topopup5\" val='" + data.d[i].ID + "'>Calificación:</a>" +
                                                              "<span id=\"spnCalificación-" + data.d[i].ID + "\"> <b " + color(data.d[i].Calification) + ">" +
                                                                 data.d[i].Calification + "</b></span>" +
                                                           

                                                             "</p>" +
                                                         "<p>" +
                                                              "<a href=\"javascript:void(0);\" class=\"topopup6\" val='" + data.d[i].ID + "'>Importancia:</a>" +
                                                               "<span id=\"spnImportancia-" + data.d[i].ID + "\"> " + data.d[i].Important + " </span>" +
                                                               

                                                               "</p>" +
                                                     "</div>" +
                                                     "<div class=\"button\">" +
                                                         "<a href=\"#\" val='" + data.d[i].ID + "' class=\"topopup4\" title=\"Read More\">" +
                                                             "<img src=\"../images/icon.jpg\">" +
                                                         "</a><a title=\"Share News\" href=\"#\" class=\"topopup\" val='" + data.d[i].ID + "' subject='" + data.d[i].Title + "' SentBy='" + $('#hdnUserID').val() + "'>" +
                                                             "<img src=\"../images/icon1.jpg\"></a> <a title='Comments " + data.d[i].Totalrecord + "' href=\"#\" class=\"topopup2\"" +
                                                                 "val='" + data.d[i].ID + "'>" +
                                                                 "<img src='" + checkComment(data.d[i].Totalrecord) + "'>" +
                                                             "</a><a title=\"Listen Audio\" href=\"javascript:void(0);\" onclick=\"PopupCenter('../sitefiles/NewsAlertradio.aspx?SectionCode=" + data.d[i].SectionCode + "&t=f&ID=" + data.d[i].ID + "', '_blank', 350, 280); \">" +
                                                                 "<img src=\"../images/view-icon.jpg\">" +
                                                             "</a><a title=\"Share Audio\" href=\"#\" class=\"topopup3\" val='" + data.d[i].ID + "'" +
                                                                 "sectioncode='" + data.d[i].SectionCode + "' mediatypename='" + data.d[i].MediaTypeName + "'" +
                                                                 "imageaudiovideoname='" + data.d[i].ImageAudioVideoName + "' subject='" + data.d[i].Title + "' SentBy='" + $('#hdnUserID').val() + "'>" +
                                                                 "<img alt=\"share-video\" src=\"../images/share-video.jpg\" />" +
                                                             "</a><a title=\"download\" onclick='javascript:GetDownload(\"" + data.d[i].ID + "\", \"radio\"); return false;' href=\"javascript:void(0);\"" +
                                         "style='display: " + data.d[i].MediaTypeCode + " == \"3\" ? \"inline\" : \"none\"  '>" +
                                         "<img " +
                                             "src=\"../images/download.jpg\" /></a>" +
                                                     "</div>" +
                                                 "</div>");
                                }
                                if (i == 2) {


                                    $('#ltrRadioNext').html("<h2>Radio - <small>" + data.d[i].RFDate + "</small></h2> <div class='press-data'><h5>" + data.d[i].Title + "</h5> <div class='info'><p><b>Fecha:</b> " + data.d[i].RFDate + "</p><p><b>Medio:</b><span class='blue-color'> " + data.d[i].MediaName + "</span></p></div></div>");
                                }
                            }
                        }
                    }
                })
            });

        });
          
    </script>
    <script>
        $(document).ready(function () {
            $("#aRadioAlreadyRead").click(function () {

                var ID = $('#hdnRadioAlreadyRead').val();
                var class1 = $(this).val();
                if (postTimeRadio == 1) {

                    ID = parseInt(ID) + 1;
                    postTimeRadio = 0;
                }
                var jsdata = '{ID:' + ID + ',"code":"Radio","click":"P"}';
                $.ajax({

                    type: "POST",

                    url: "NewAll-newsalertPendingMultiMedia.aspx/getmultiScroll",

                    data: jsdata,

                    contentType: "application/json",
                    dataType: "json",
                    success: function (data) {
                        if (data.d.length < 1) {
                            alert('No more news');
                        }
                        else {
                            for (var i = 0; i < data.d.length; i++) {
                                if (data.d.length == 2) {
                                    postTimeRadio = 1;
                                    if (i == 1) {
                                        $('#hdnRadioAlreadyRead').val(data.d[i].ID);
                                        $('#ltrRadioAlreadyRead').html("<h2>Radio - <small>" + data.d[i].RFDate + "</small></h2> <div class='press-data'><h5>" + data.d[i].Title + "</h5> <div class='info'><p><b>Fecha:</b> " + data.d[i].RFDate + "</p><p><b>Medio:</b><span class='blue-color'> " + data.d[i].MediaName + "</span></p></div></div>");
                                    }
                                    if (i == 0) {
                                        $('#ltrRadioCurrent').html("<h2>Radio- <small>" +
                                                       data.d[i].RFDate + "</small></h2>" +
                                                "<div class=\"press-data\">" +
                                                   "<h5><a class='topopup4' style='cursor:pointer' val='" + data.d[i].ID + "'>"
                                                    + data.d[i].Title + "</a></h5>" +
                                                    "<div class=\"info\">" +
                                                        "<p>" +
                                                            "<b>Fecha:</b>" +
                                                           data.d[i].RFDate + "</p>" +
                                                        "<p>" +
                                                            "<b>Medio:</b><span class=\"blue-color\">" +
                                                                 data.d[i].MediaName +
                                                            "</span>" +
                                                        "</p>" +
                                                        "<p>" +
                                                            "<b>Pagina:</b>" +
                                                             data.d[i].PageorHour + "</p>" +
                                                        "<p>" +
                                                            "<b>Seccion:</b> <span>" +
                                                                 data.d[i].SectionDescription + "</span></p>" +
                                                    "</div>" +
                                                    "<div class=\"press-detail\" id='IDPress-" + data.d[i].ID + "'>" +
                                                        "<p>" +
                                                            data.d[i].NewsSummary + "</p>" +
                                                    "</div>" +
                                                    "<div class=\"press-detail\" style=\"display: none;\" id='IDPressText-" + data.d[i].ID + "'>" +
                                                        "<p>" +
                                                             data.d[i].News + "</p>" +
                                                    "</div>" +
                                                "</div>" +
                                                "<div class=\"button-div\">" +
                                                   "<div class=\"button-div-text\">" +
                                                         "<p>" +
                                                             "<a href=\"javascript:void(0);\"  class=\"topopup5\" val='" + data.d[i].ID + "'>Calificación:</a>" +
                                                              "<span id=\"spnCalificación-" + data.d[i].ID + "\"> <b " + color(data.d[i].Calification) + ">" +
                                                                 data.d[i].Calification + "</b></span>" +
                                                            

                                                             "</p>" +
                                                         "<p>" +
                                                              "<a href=\"javascript:void(0);\" class=\"topopup6\" val='" + data.d[i].ID + "'>Importancia:</a>" +
                                                               "<span id=\"spnImportancia-" + data.d[i].ID + "\"> " + data.d[i].Important + " </span>" +
                                                              

                                                               "</p>" +
                                                     "</div>" +
                                                     "<div class=\"button\">" +
                                                         "<a href=\"#\" val='" + data.d[i].ID + "' class=\"topopup4\" title=\"Read More\">" +
                                                             "<img src=\"../images/icon.jpg\">" +
                                                         "</a><a title=\"Share News\" href=\"#\" class=\"topopup\" val='" + data.d[i].ID + "' subject='" + data.d[i].Title + "' SentBy='" + $('#hdnUserID').val() + "'>" +
                                                             "<img src=\"../images/icon1.jpg\"></a> <a title='Comments " + data.d[i].Totalrecord + "' href=\"#\" class=\"topopup2\"" +
                                                                 "val='" + data.d[i].ID + "'>" +
                                                                 "<img src='" + checkComment(data.d[i].Totalrecord) + "'>" +
                                                             "</a><a title=\"Listen Audio\" href=\"javascript:void(0);\" onclick=\"PopupCenter('../sitefiles/NewsAlertradio.aspx?SectionCode=" + data.d[i].SectionCode + "&t=f&ID=" + data.d[i].ID + "', '_blank', 350, 280); \">" +
                                                                 "<img src=\"../images/view-icon.jpg\">" +
                                                             "</a><a title=\"Share Audio\" href=\"#\" class=\"topopup3\" val='" + data.d[i].ID + "'" +
                                                                 "sectioncode='" + data.d[i].SectionCode + "' mediatypename='" + data.d[i].MediaTypeName + "'" +
                                                                 "imageaudiovideoname='" + data.d[i].ImageAudioVideoName + "' subject='" + data.d[i].Title + "' SentBy='" + $('#hdnUserID').val() + "'>" +
                                                                 "<img alt=\"share-video\" src=\"../images/share-video.jpg\" />" +
                                                             "</a><a title=\"download\" onclick='javascript:GetDownload(\"" + data.d[i].ID + "\", \"radio\"); return false;' href=\"javascript:void(0);\"" +
                                         "style='display: " + data.d[i].MediaTypeCode + " == \"3\" ? \"inline\" : \"none\"  '>" +
                                         "<img " +
                                             "src=\"../images/download.jpg\" /></a>" +
                                                     "</div>" +
                                                 "</div>");
                                    }

                                }
                                else if (data.d.length == 1) {
                                    $('#hdnRadioAlreadyRead').val(data.d[i].ID);
                                    $('#ltrRadioAlreadyRead').html("<h2>Radio -<small></small></h2><div class='press-data'><h5></h5> <div class='info'></div></div>");
                                    $('#ltrRadioCurrent').html("<h2>Radio- <small>" +
                                                       data.d[i].RFDate + "</small></h2>" +
                                                "<div class=\"press-data\">" +
                                                    "<h5>" +
                                                        data.d[i].Title + "</h5>" +
                                                    "<div class=\"info\">" +
                                                        "<p>" +
                                                            "<b>Fecha:</b>" +
                                                           data.d[i].RFDate + "</p>" +
                                                        "<p>" +
                                                            "<b>Medio:</b><span class=\"blue-color\">" +
                                                                 data.d[i].MediaName +
                                                            "</span>" +
                                                        "</p>" +
                                                        "<p>" +
                                                            "<b>Pagina:</b>" +
                                                             data.d[i].PageorHour + "</p>" +
                                                        "<p>" +
                                                            "<b>Seccion:</b> <span>" +
                                                                 data.d[i].SectionDescription + "</span></p>" +
                                                    "</div>" +
                                                    "<div class=\"press-detail\" id='IDPress-" + data.d[i].ID + "'>" +
                                                        "<p>" +
                                                            data.d[i].NewsSummary + "</p>" +
                                                    "</div>" +
                                                    "<div class=\"press-detail\" style=\"display: none;\" id='IDPressText-" + data.d[i].ID + "'>" +
                                                        "<p>" +
                                                             data.d[i].News + "</p>" +
                                                    "</div>" +
                                                "</div>" +
                                                "<div class=\"button-div\">" +
                                                   "<div class=\"button-div-text\">" +
                                                         "<p>" +
                                                             "<a href=\"javascript:void(0);\"  class=\"topopup5\" val='" + data.d[i].ID + "'>Calificación:</a>" +
                                                              "<span id=\"spnCalificación-" + data.d[i].ID + "\"> <b " + color(data.d[i].Calification) + ">" +
                                                                 data.d[i].Calification + "</b></span>" +
                                                            

                                                             "</p>" +
                                                         "<p>" +
                                                              "<a href=\"javascript:void(0);\" class=\"topopup6\" val='" + data.d[i].ID + "'>Importancia:</a>" +
                                                               "<span id=\"spnImportancia-" + data.d[i].ID + "\"> " + data.d[i].Important + " </span>" +
                                                              

                                                               "</p>" +
                                                     "</div>" +
                                                     "<div class=\"button\">" +
                                                         "<a href=\"#\" val='" + data.d[i].ID + "' class=\"topopup4\" title=\"Read More\">" +
                                                             "<img src=\"../images/icon.jpg\">" +
                                                         "</a><a title=\"Share News\" href=\"#\" class=\"topopup\" val='" + data.d[i].ID + "' subject='" + data.d[i].Title + "' SentBy='" + $('#hdnUserID').val() + "'>" +
                                                             "<img src=\"../images/icon1.jpg\"></a> <a title='Comments " + data.d[i].Totalrecord + "' href=\"#\" class=\"topopup2\"" +
                                                                 "val='" + data.d[i].ID + "'>" +
                                                                 "<img src='" + checkComment(data.d[i].Totalrecord) + "'>" +
                                                             "</a><a title=\"Listen Audio\" href=\"javascript:void(0);\" onclick=\"PopupCenter('../sitefiles/NewsAlertradio.aspx?SectionCode=" + data.d[i].SectionCode + "&t=f&ID=" + data.d[i].ID + "', '_blank', 350, 280); \">" +
                                                                 "<img src=\"../images/view-icon.jpg\">" +
                                                             "</a><a title=\"Share Audio\" href=\"#\" class=\"topopup3\" val='" + data.d[i].ID + "'" +
                                                                 "sectioncode='" + data.d[i].SectionCode + "' mediatypename='" + data.d[i].MediaTypeName + "'" +
                                                                 "imageaudiovideoname='" + data.d[i].ImageAudioVideoName + "' subject='" + data.d[i].Title + "' SentBy='" + $('#hdnUserID').val() + "'>" +
                                                                 "<img alt=\"share-video\" src=\"../images/share-video.jpg\" />" +
                                                             "</a><a title=\"download\" onclick='javascript:GetDownload(\"" + data.d[i].ID + "\", \"radio\"); return false;' href=\"javascript:void(0);\"" +
                                         "style='display: " + data.d[i].MediaTypeCode + " == \"3\" ? \"inline\" : \"none\"  '>" +
                                         "<img " +
                                             "src=\"../images/download.jpg\" /></a>" +
                                                     "</div>" +
                                                 "</div>");
                                }
                                else {
                                    if (i == 0) {
                                        $('#hdnRadioAlreadyRead').val(data.d[i].ID);
                                        $('#ltrRadioAlreadyRead').html("<h2>Radio - <small>" + data.d[i].RFDate + "</small></h2> <div class='press-data'><h5>" + data.d[i].Title + "</h5> <div class='info'><p><b>Fecha:</b> " + data.d[i].RFDate + "</p><p><b>Medio:</b><span class='blue-color'> " + data.d[i].MediaName + "</span></p></div></div>");
                                    }
                                    if (i == 1) {
                                        $('#ltrRadioCurrent').html("<h2>Radio- <small>" +
                                                       data.d[i].RFDate + "</small></h2>" +
                                                "<div class=\"press-data\">" +
                                                    "<h5>" +
                                                        data.d[i].Title + "</h5>" +
                                                    "<div class=\"info\">" +
                                                        "<p>" +
                                                            "<b>Fecha:</b>" +
                                                           data.d[i].RFDate + "</p>" +
                                                        "<p>" +
                                                            "<b>Medio:</b><span class=\"blue-color\">" +
                                                                 data.d[i].MediaName +
                                                            "</span>" +
                                                        "</p>" +
                                                        "<p>" +
                                                            "<b>Pagina:</b>" +
                                                             data.d[i].PageorHour + "</p>" +
                                                        "<p>" +
                                                            "<b>Seccion:</b> <span>" +
                                                                 data.d[i].SectionDescription + "</span></p>" +
                                                    "</div>" +
                                                    "<div class=\"press-detail\" id='IDPress-" + data.d[i].ID + "'>" +
                                                        "<p>" +
                                                            data.d[i].NewsSummary + "</p>" +
                                                    "</div>" +
                                                    "<div class=\"press-detail\" style=\"display: none;\" id='IDPressText-" + data.d[i].ID + "'>" +
                                                        "<p>" +
                                                             data.d[i].News + "</p>" +
                                                    "</div>" +
                                                "</div>" +
                                                "<div class=\"button-div\">" +
                                                   "<div class=\"button-div-text\">" +
                                                         "<p>" +
                                                             "<a href=\"javascript:void(0);\"  class=\"topopup5\" val='" + data.d[i].ID + "'>Calificación:</a>" +
                                                              "<span id=\"spnCalificación-" + data.d[i].ID + "\"> <b " + color(data.d[i].Calification) + ">" +
                                                                 data.d[i].Calification + "</b></span>" +
                                                             

                                                             "</p>" +
                                                         "<p>" +
                                                              "<a href=\"javascript:void(0);\" class=\"topopup6\" val='" + data.d[i].ID + "'>Importancia:</a>" +
                                                               "<span id=\"spnImportancia-" + data.d[i].ID + "\"> " + data.d[i].Important + " </span>" +
                                                              
                                                               "</p>" +
                                                     "</div>" +
                                                     "<div class=\"button\">" +
                                                         "<a href=\"#\" val='" + data.d[i].ID + "' class=\"topopup4\" title=\"Read More\">" +
                                                             "<img src=\"../images/icon.jpg\">" +
                                                         "</a><a title=\"Share News\" href=\"#\" class=\"topopup\" val='" + data.d[i].ID + "' subject='" + data.d[i].Title + "' SentBy='" + $('#hdnUserID').val() + "'>" +
                                                             "<img src=\"../images/icon1.jpg\"></a> <a title='Comments " + data.d[i].Totalrecord + "' href=\"#\" class=\"topopup2\"" +
                                                                 "val='" + data.d[i].ID + "'>" +
                                                                 "<img src='" + checkComment(data.d[i].Totalrecord) + "'>" +
                                                             "</a><a title=\"Listen Audio\" href=\"javascript:void(0);\" onclick=\"PopupCenter('../sitefiles/NewsAlertradio.aspx?SectionCode=" + data.d[i].SectionCode + "&t=f&ID=" + data.d[i].ID + "', '_blank', 350, 280); \">" +
                                                                 "<img src=\"../images/view-icon.jpg\">" +
                                                             "</a><a title=\"Share Audio\" href=\"#\" class=\"topopup3\" val='" + data.d[i].ID + "'" +
                                                                 "sectioncode='" + data.d[i].SectionCode + "' mediatypename='" + data.d[i].MediaTypeName + "'" +
                                                                 "imageaudiovideoname='" + data.d[i].ImageAudioVideoName + "' subject='" + data.d[i].Title + "' SentBy='" + $('#hdnUserID').val() + "'>" +
                                                                 "<img alt=\"share-video\" src=\"../images/share-video.jpg\" />" +
                                                             "</a><a title=\"download\" onclick='javascript:GetDownload(\"" + data.d[i].ID + "\", \"radio\"); return false;' href=\"javascript:void(0);\"" +
                                         "style='display: " + data.d[i].MediaTypeCode + " == \"3\" ? \"inline\" : \"none\"  '>" +
                                         "<img " +
                                             "src=\"../images/download.jpg\" /></a>" +
                                                     "</div>" +
                                                 "</div>");

                                    }
                                    if (i == 2) {


                                        $('#ltrRadioNext').html("<h2>Radio - <small>" + data.d[i].RFDate + "</small></h2> <div class='press-data'><h5>" + data.d[i].Title + "</h5> <div class='info'><p><b>Fecha:</b> " + data.d[i].RFDate + "</p><p><b>Medio:</b><span class='blue-color'> " + data.d[i].MediaName + "</span></p></div></div>");
                                    }
                                }
                            }
                        }
                    }
                })
            });

        });
          
    </script>
    <script>
        var postTimeInternet = 0;
        $(document).ready(function () {
            $("#aInternetNext").click(function () {

                var ID = $('#hdnInternetAlreadyRead').val();
                var class1 = $(this).val();
                if (postTimeInternet == 0) {

                    ID = ID - 1;
                    postTimeInternet = 1;
                }
                var jsdata = '{ID:' + ID + ',"code":"Internet","click":"N"}';
                $.ajax({

                    type: "POST",

                    url: "NewAll-newsalertPendingMultiMedia.aspx/getmultiScroll",

                    data: jsdata,

                    contentType: "application/json",
                    dataType: "json",
                    success: function (data) {
                        if (data.d.length < 2) {
                            $('#ltrInternetNext').html("<h2>Internet-<small></small></h2><div class='press-data'><h5></h5> <div class='info'></div></div>");
                            alert('No more news');

                        }
                        else {
                            for (var i = 0; i < data.d.length; i++) {
                                if (i == 0) {
                                    $('#hdnInternetAlreadyRead').val(data.d[i].ID);

                                    $('#ltrInternetAlreadyRead').html("<h2>Internet-<small>" + data.d[i].RFDate + "</small></h2> <div class='press-data'><h5>" + data.d[i].Title + "</h5> <div class='info'><p><b>Fecha:</b> " + data.d[i].RFDate + "</p><p><b>Medio:</b><span class='blue-color'> " + data.d[i].MediaName + "</span></p></div></div>");
                                }
                                if (i == 1) {
                                    $('#ltrInternetCurrent').html("<h2>Internet-<small>" +
                                                       data.d[i].RFDate + "</small></h2>" +
                                                "<div class=\"press-data\">" +
                                                    "<h5><a class='topopup4' style='cursor:pointer' val='" + data.d[i].ID + "'>"
                                                    + data.d[i].Title + "</a></h5>" +
                                                    "<div class=\"info\">" +
                                                        "<p>" +
                                                            "<b>Fecha:</b>" +
                                                           data.d[i].RFDate + "</p>" +
                                                        "<p>" +
                                                            "<b>Medio:</b><span class=\"blue-color\">" +
                                                                 data.d[i].MediaName +
                                                            "</span>" +
                                                        "</p>" +
                                                        "<p>" +
                                                            "<b>Pagina:</b>" +
                                                             data.d[i].PageorHour + "</p>" +
                                                        "<p>" +
                                                            "<b>Seccion:</b> <span>" +
                                                                 data.d[i].SectionDescription + "</span></p>" +
                                                    "</div>" +
                                                    "<div class=\"press-detail\" id='IDPress-" + data.d[i].ID + "'>" +
                                                        "<p>" +
                                                            data.d[i].NewsSummary + "</p>" +
                                                    "</div>" +
                                                    "<div class=\"press-detail\" style=\"display: none;\" id='IDPressText-" + data.d[i].ID + "'>" +
                                                        "<p>" +
                                                             data.d[i].News + "</p>" +
                                                    "</div>" +
                                                "</div>" +
                                                "<div class=\"button-div\">" +
                                                       "<div class=\"button-div-text\">" +
                                                        "<p>" +
                                                            "<a href=\"javascript:void(0);\"  class=\"topopup5\" val='" + data.d[i].ID + "'>Calificación:</a>" +
                                                            "<span id=\"spnCalificación-" + data.d[i].ID + "\"> <b " + color(data.d[i].Calification) + ">" +
                                                                data.d[i].Calification + "</b></span>" +
                                                            

                                                             "</p>" +
                                                        "<p>" +
                                                             "<a href=\"javascript:void(0);\" class=\"topopup6\" val='" + data.d[i].ID + "'>Importancia:</a>" +
                                                             "<span id=\"spnImportancia-" + data.d[i].ID + "\"> " + data.d[i].Important + " </span>" +
                                                             
                                                               "</p>" +
                                                    "</div>" +
                                                    "<div class=\"button\">" +
                                                        "<a href=\"#\" val='" + data.d[i].ID + "' class=\"topopup4\" title=\"Read More\">" +
                                                            "<img src=\"../images/icon.jpg\">" +
                                                        "</a><a title=\"Share News\" href=\"#\" class=\"topopup\" val='" + data.d[i].ID + "' subject='" + data.d[i].Title + "' SentBy='" + $('#hdnUserID').val() + "'>" +
                                                            "<img src=\"../images/icon1.jpg\"></a> <a title='Comments " + data.d[i].Totalrecord + "' href=\"#\" class=\"topopup2\"" +
                                                                "val='" + data.d[i].ID + "'>" +
                                                               "<img src='" + checkComment(data.d[i].Totalrecord) + "'>" +
                                                            "</a><a title=\"View\" href=\"javascript:void(0);\" onclick=\"PopupCenterWithScroll('../sitefiles/Internet.aspx?ID=" + data.d[i].ID + "&t=s&file=" + data.d[i].ImageAudioVideoName + "', '_blank', 750, 700); \">" +
                                                                "<img src=\"../images/view-icon.jpg\"></a><a title=\"Share Image\" href=\"#\" class=\"topopup3\"" +
                                                                    "val='" + data.d[i].ID + "' sectioncode='" + data.d[i].SectionCode + "' mediatypename='" + data.d[i].MediaTypeName + "'" +
                                                                    "imageaudiovideoname='" + data.d[i].ImageAudioVideoName + "' subject='" + data.d[i].Title + "' SentBy='" + $('#hdnUserID').val() + "'><img alt=\"Share Vedio\" src=\"../images/share-video.jpg\" />" +
                                                                "</a><a title=\"download\" onclick='javascript:GetDownload(\"" + data.d[i].ID + "\", \"Internet\"); return false;'" +
                                            "href=\"javascript:void(0);\" style='display: " + data.d[i].MediaTypeCode + " == \"9\" ? \"inline\" : \"none\"  '>" +
                                            "<img src=\"../images/download.jpg\" /></a>" +
                                                    "</div></div>");
                                }
                                if (i == 2) {


                                    $('#ltrInternetNext').html("<h2>Internet-<small>" + data.d[i].RFDate + "</small></h2> <div class='press-data'><h5>" + data.d[i].Title + "</h5> <div class='info'><p><b>Fecha:</b> " + data.d[i].RFDate + "</p><p><b>Medio:</b><span class='blue-color'> " + data.d[i].MediaName + "</span></p></div></div>");
                                }
                            }
                        }
                    }
                })
            });

        });
          
    </script>
    <script>
        $(document).ready(function () {
            $("#aInternetAlreadyRead").click(function () {

                var ID = $('#hdnInternetAlreadyRead').val();
                var class1 = $(this).val();
                if (postTimeInternet == 1) {

                    ID = parseInt(ID) + 1;
                    postTimeInternet = 0;
                }
                var jsdata = '{ID:' + ID + ',"code":"Internet","click":"P"}';
                $.ajax({

                    type: "POST",

                    url: "NewAll-newsalertPendingMultiMedia.aspx/getmultiScroll",

                    data: jsdata,

                    contentType: "application/json",
                    dataType: "json",
                    success: function (data) {
                        if (data.d.length < 1) {
                            alert('No more news');
                        }
                        else {
                            if (postTimeInternet == 0) {

                                var jsdata1 = '{ID:' + $('#hdnInternetAlreadyRead').val() + ',"mediaTypeName":"Internet"}';

                                $.ajax({

                                    type: "POST",

                                    url: "NewAll-newsalertLastMultiMedia.aspx/News",

                                    data: jsdata1,

                                    contentType: "application/json",
                                    dataType: "json",
                                    success: function (data) {
                                        for (var i = 0; i < data.d.length; i++) {
                                            $('#ltrInternetNext').html("<h2>Internet - <small>" + data.d[i].RFDate + "</small></h2> <div class='press-data'><h5>" + data.d[i].Title + "</h5> <div class='info'><p><b>Fecha:</b> " + data.d[i].RFDate + "</p><p><b>Medio:</b><span class='blue-color'> " + data.d[i].MediaName + "</span></p></div></div>");
                                        }
                                    }
                                });
                            }
                            for (var i = 0; i < data.d.length; i++) {
                                if (data.d.length == 2) {
                                    postTimeInternet = 1;
                                    if (i == 1) {
                                        $('#hdnInternetAlreadyRead').val(data.d[i].ID);
                                        $('#ltrInternetAlreadyRead').html("<h2>Internet-<small>" + data.d[i].RFDate + "</small></h2> <div class='press-data'><h5>" + data.d[i].Title + "</h5> <div class='info'><p><b>Fecha:</b> " + data.d[i].RFDate + "</p><p><b>Medio:</b><span class='blue-color'> " + data.d[i].MediaName + "</span></p></div></div>");
                                    }
                                    if (i == 0) {
                                        $('#ltrInternetCurrent').html("<h2>Internet-<small>" +
                                                       data.d[i].RFDate + "</small></h2>" +
                                                "<div class=\"press-data\">" +
                                                    "<h5><a class='topopup4' style='cursor:pointer' val='" + data.d[i].ID + "'>"
                                                    + data.d[i].Title + "</a></h5>" +
                                                    "<div class=\"info\">" +
                                                        "<p>" +
                                                            "<b>Fecha:</b>" +
                                                           data.d[i].RFDate + "</p>" +
                                                        "<p>" +
                                                            "<b>Medio:</b><span class=\"blue-color\">" +
                                                                 data.d[i].MediaName +
                                                            "</span>" +
                                                        "</p>" +
                                                        "<p>" +
                                                            "<b>Pagina:</b>" +
                                                             data.d[i].PageorHour + "</p>" +
                                                        "<p>" +
                                                            "<b>Seccion:</b> <span>" +
                                                                 data.d[i].SectionDescription + "</span></p>" +
                                                    "</div>" +
                                                    "<div class=\"press-detail\" id='IDPress-" + data.d[i].ID + "'>" +
                                                        "<p>" +
                                                            data.d[i].NewsSummary + "</p>" +
                                                    "</div>" +
                                                    "<div class=\"press-detail\" style=\"display: none;\" id='IDPressText-" + data.d[i].ID + "'>" +
                                                        "<p>" +
                                                             data.d[i].News + "</p>" +
                                                    "</div>" +
                                                "</div>" +
                                                "<div class=\"button-div\">" +
                                                       "<div class=\"button-div-text\">" +
                                                        "<p>" +
                                                            "<a href=\"javascript:void(0);\"  class=\"topopup5\" val='" + data.d[i].ID + "'>Calificación:</a>" +
                                                            "<span id=\"spnCalificación-" + data.d[i].ID + "\"> <b " + color(data.d[i].Calification) + ">" +
                                                                data.d[i].Calification + "</b></span>" +
                                                          

                                                             "</p>" +
                                                        "<p>" +
                                                             "<a href=\"javascript:void(0);\" class=\"topopup6\" val='" + data.d[i].ID + "'>Importancia:</a>" +
                                                             "<span id=\"spnImportancia-" + data.d[i].ID + "\"> " + data.d[i].Important + " </span>" +
                                                              "<div id='divInternetImportancia-" + data.d[i].ID + "' style=\"display: none; float: right; margin-top: -18px;\">" +
                                                                "<select class=\"dllInternetImportancia\" style=\"width: 100px;\">" +
                                                                    "<option value=\"1\">1</option>" +
                                                                    "<option value=\"2\">2</option>" +
                                                                    "<option value=\"3\">3</option>" +
                                                                    "<option value=\"4\">4</option>" +
                                                                    "<option value=\"5\">5</option>" +
                                                                "</select>" +
                                                            "</div>" +
                                                             "<span>" +
                                                               "</p>" +
                                                    "</div>" +
                                                    "<div class=\"button\">" +
                                                        "<a href=\"#\" val='" + data.d[i].ID + "' class=\"topopup4\" title=\"Read More\">" +
                                                            "<img src=\"../images/icon.jpg\">" +
                                                        "</a><a title=\"Share News\" href=\"#\" class=\"topopup\" val='" + data.d[i].ID + "' subject='" + data.d[i].Title + "' SentBy='" + $('#hdnUserID').val() + "'>" +
                                                            "<img src=\"../images/icon1.jpg\"></a> <a title='Comments " + data.d[i].Totalrecord + "' href=\"#\" class=\"topopup2\"" +
                                                                "val='" + data.d[i].ID + "'>" +
                                                               "<img src='" + checkComment(data.d[i].Totalrecord) + "'>" +
                                                            "</a><a title=\"View\" href=\"javascript:void(0);\" onclick=\"PopupCenterWithScroll('../sitefiles/Internet.aspx?ID=" + data.d[i].ID + "&t=s&file=" + data.d[i].ImageAudioVideoName + "', '_blank', 750, 700); \">" +
                                                                "<img src=\"../images/view-icon.jpg\"></a><a title=\"Share Image\" href=\"#\" class=\"topopup3\"" +
                                                                    "val='" + data.d[i].ID + "' sectioncode='" + data.d[i].SectionCode + "' mediatypename='" + data.d[i].MediaTypeName + "'" +
                                                                    "imageaudiovideoname='" + data.d[i].ImageAudioVideoName + "' subject='" + data.d[i].Title + "' SentBy='" + $('#hdnUserID').val() + "'><img alt=\"Share Vedio\" src=\"../images/share-video.jpg\" />" +
                                                                "</a><a onclick='javascript:GetDownload(\"" + data.d[i].ID + "\", \"Internet\"); return false;'" +
                                            "href=\"javascript:void(0);\" title=\"Download\" style='display: " + data.d[i].MediaTypeCode + " == \"9\" ? \"inline\" : \"none\"  '>" +
                                            "<img src=\"../images/download.jpg\" /></a>" +
                                                    "</div>" + "</div>");

                                    }
                                }
                                else if (data.d.length == 1) {
                                    $('#hdnInternetAlreadyRead').val(data.d[i].ID);
                                    $('#ltrInternetAlreadyRead').html("<h2>Internet-<small></small></h2><div class='press-data'><h5></h5> <div class='info'></div></div>");
                                    $('#ltrInternetCurrent').html("<h2>Internet-<small>" +
                                                       data.d[i].RFDate + "</small></h2>" +
                                                "<div class=\"press-data\">" +
                                                    "<h5>" +
                                                        data.d[i].Title + "</h5>" +
                                                    "<div class=\"info\">" +
                                                        "<p>" +
                                                            "<b>Fecha:</b>" +
                                                           data.d[i].RFDate + "</p>" +
                                                        "<p>" +
                                                            "<b>Medio:</b><span class=\"blue-color\">" +
                                                                 data.d[i].MediaName +
                                                            "</span>" +
                                                        "</p>" +
                                                        "<p>" +
                                                            "<b>Pagina:</b>" +
                                                             data.d[i].PageorHour + "</p>" +
                                                        "<p>" +
                                                            "<b>Seccion:</b> <span>" +
                                                                 data.d[i].SectionDescription + "</span></p>" +
                                                    "</div>" +
                                                    "<div class=\"press-detail\" id='IDPress-" + data.d[i].ID + "'>" +
                                                        "<p>" +
                                                            data.d[i].NewsSummary + "</p>" +
                                                    "</div>" +
                                                    "<div class=\"press-detail\" style=\"display: none;\" id='IDPressText-" + data.d[i].ID + "'>" +
                                                        "<p>" +
                                                             data.d[i].News + "</p>" +
                                                    "</div>" +
                                                "</div>" +
                                                "<div class=\"button-div\">" +
                                                       "<div class=\"button-div-text\">" +
                                                        "<p>" +
                                                            "<a href=\"javascript:void(0);\"  class=\"topopup5\" val='" + data.d[i].ID + "'>Calificación:</a>" +
                                                            "<span id=\"spnCalificación-" + data.d[i].ID + "\"> <b " + color(data.d[i].Calification) + ">" +
                                                                data.d[i].Calification + "</b></span>" +
                                                          
                                                             "</p>" +
                                                        "<p>" +
                                                             "<a href=\"javascript:void(0);\" class=\"topopup6\" val='" + data.d[i].ID + "'>Importancia:</a>" +
                                                             "<span id=\"spnImportancia-" + data.d[i].ID + "\"> " + data.d[i].Important + " </span>" +
                                                             
                                                           
                                                               "</p>" +
                                                    "</div>" +
                                                    "<div class=\"button\">" +
                                                        "<a href=\"#\" val='" + data.d[i].ID + "' class=\"topopup4\" title=\"Read More\">" +
                                                            "<img src=\"../images/icon.jpg\">" +
                                                        "</a><a title=\"Share News\" href=\"#\" class=\"topopup\" val='" + data.d[i].ID + "' subject='" + data.d[i].Title + "' SentBy='" + $('#hdnUserID').val() + "'>" +
                                                            "<img src=\"../images/icon1.jpg\"></a> <a title='Comments " + data.d[i].Totalrecord + "' href=\"#\" class=\"topopup2\"" +
                                                                "val='" + data.d[i].ID + "'>" +
                                                               "<img src='" + checkComment(data.d[i].Totalrecord) + "'>" +
                                                            "</a><a title=\"View\" href=\"javascript:void(0);\" onclick=\"PopupCenterWithScroll('../sitefiles/Internet.aspx?ID=" + data.d[i].ID + "&t=s&file=" + data.d[i].ImageAudioVideoName + "', '_blank', 750, 700); \">" +
                                                                "<img src=\"../images/view-icon.jpg\"></a><a title=\"Share Image\" href=\"#\" class=\"topopup3\"" +
                                                                    "val='" + data.d[i].ID + "' sectioncode='" + data.d[i].SectionCode + "' mediatypename='" + data.d[i].MediaTypeName + "'" +
                                                                    "imageaudiovideoname='" + data.d[i].ImageAudioVideoName + "' subject='" + data.d[i].Title + "' SentBy='" + $('#hdnUserID').val() + "'><img alt=\"Share Vedio\" src=\"../images/share-video.jpg\" />" +
                                                                "</a><a onclick='javascript:GetDownload(\"" + data.d[i].ID + "\", \"Internet\"); return false;'" +
                                            "href=\"javascript:void(0);\" title=\"Download\" style='display: " + data.d[i].MediaTypeCode + " == \"9\" ? \"inline\" : \"none\"  '>" +
                                            "<img src=\"../images/download.jpg\" /></a>" +
                                                    "</div>" + "</div>");
                                }
                                else {
                                    if (i == 0) {
                                        $('#hdnInternetAlreadyRead').val(data.d[i].ID);
                                        $('#ltrInternetAlreadyRead').html("<h2>Internet-<small>" + data.d[i].RFDate + "</small></h2> <div class='press-data'><h5>" + data.d[i].Title + "</h5> <div class='info'><p><b>Fecha:</b> " + data.d[i].RFDate + "</p><p><b>Medio:</b><span class='blue-color'> " + data.d[i].MediaName + "</span></p></div></div>");
                                    }
                                    if (i == 1) {
                                        $('#ltrInternetCurrent').html("<h2>Internet-<small>" +
                                                       data.d[i].RFDate + "</small></h2>" +
                                                "<div class=\"press-data\">" +
                                                    "<h5>" +
                                                        data.d[i].Title + "</h5>" +
                                                    "<div class=\"info\">" +
                                                        "<p>" +
                                                            "<b>Fecha:</b>" +
                                                           data.d[i].RFDate + "</p>" +
                                                        "<p>" +
                                                            "<b>Medio:</b><span class=\"blue-color\">" +
                                                                 data.d[i].MediaName +
                                                            "</span>" +
                                                        "</p>" +
                                                        "<p>" +
                                                            "<b>Pagina:</b>" +
                                                             data.d[i].PageorHour + "</p>" +
                                                        "<p>" +
                                                            "<b>Seccion:</b> <span>" +
                                                                 data.d[i].SectionDescription + "</span></p>" +
                                                    "</div>" +
                                                    "<div class=\"press-detail\" id='IDPress-" + data.d[i].ID + "'>" +
                                                        "<p>" +
                                                            data.d[i].NewsSummary + "</p>" +
                                                    "</div>" +
                                                    "<div class=\"press-detail\" style=\"display: none;\" id='IDPressText-" + data.d[i].ID + "'>" +
                                                        "<p>" +
                                                             data.d[i].News + "</p>" +
                                                    "</div>" +
                                                "</div>" +
                                                "<div class=\"button-div\">" +
                                                       "<div class=\"button-div-text\">" +
                                                        "<p>" +
                                                            "<a href=\"javascript:void(0);\"  class=\"topopup5\" val='" + data.d[i].ID + "'>Calificación:</a>" +
                                                            "<span id=\"spnCalificación-" + data.d[i].ID + "\"> <b " + color(data.d[i].Calification) + ">" +
                                                                data.d[i].Calification + "</b></span>" +
                                                            

                                                             "</p>" +
                                                        "<p>" +
                                                             "<a href=\"javascript:void(0);\" class=\"topopup6\" val='" + data.d[i].ID + "'>Importancia:</a>" +
                                                             "<span id=\"spnImportancia-" + data.d[i].ID + "\"> " + data.d[i].Important + " </span>" +
                                                              
                                                               "</p>" +
                                                    "</div>" +
                                                    "<div class=\"button\">" +
                                                        "<a href=\"#\" val='" + data.d[i].ID + "' class=\"topopup4\" title=\"Read More\">" +
                                                            "<img src=\"../images/icon.jpg\">" +
                                                        "</a><a title=\"Share News\" href=\"#\" class=\"topopup\" val='" + data.d[i].ID + "' subject='" + data.d[i].Title + "' SentBy='" + $('#hdnUserID').val() + "'>" +
                                                            "<img src=\"../images/icon1.jpg\"></a> <a title='Comments " + data.d[i].Totalrecord + "' href=\"#\" class=\"topopup2\"" +
                                                                "val='" + data.d[i].ID + "'>" +
                                                               "<img src='" + checkComment(data.d[i].Totalrecord) + "'>" +
                                                            "</a><a title=\"View\" href=\"javascript:void(0);\" onclick=\"PopupCenterWithScroll('../sitefiles/Internet.aspx?ID=" + data.d[i].ID + "&t=s&file=" + data.d[i].ImageAudioVideoName + "', '_blank', 750, 700); \">" +
                                                                "<img src=\"../images/view-icon.jpg\"></a><a title=\"Share Image\" href=\"#\" class=\"topopup3\"" +
                                                                    "val='" + data.d[i].ID + "' sectioncode='" + data.d[i].SectionCode + "' mediatypename='" + data.d[i].MediaTypeName + "'" +
                                                                    "imageaudiovideoname='" + data.d[i].ImageAudioVideoName + "' subject='" + data.d[i].Title + "' SentBy='" + $('#hdnUserID').val() + "'><img alt=\"Share Vedio\" src=\"../images/share-video.jpg\" />" +
                                                                "</a><a onclick='javascript:GetDownload(\"" + data.d[i].ID + "\", \"Internet\"); return false;'" +
                                            "href=\"javascript:void(0);\" title=\"Download\" style='display: " + data.d[i].MediaTypeCode + " == \"9\" ? \"inline\" : \"none\"  '>" +
                                            "<img src=\"../images/download.jpg\" /></a>" +
                                                    "</div>" + "</div>");

                                    }
                                    if (i == 2) {


                                        $('#ltrInternetNext').html("<h2>Internet-<small>" + data.d[i].RFDate + "</small></h2> <div class='press-data'><h5>" + data.d[i].Title + "</h5> <div class='info'><p><b>Fecha:</b> " + data.d[i].RFDate + "</p><p><b>Medio:</b><span class='blue-color'> " + data.d[i].MediaName + "</span></p></div></div>");
                                    }
                                }
                            }
                        }
                    }
                })
            });

        });
          
    </script>
    <script type="text/javascript">
        function showNestedGridView(obj, obj2) {
            var nestedGridView = document.getElementById(obj);
            var divText = document.getElementById(obj2);
            //var imageID = document.getElementById('image' + obj);

            if (nestedGridView.style.display == "none") {
                nestedGridView.style.display = "block";
                divText.style.display = "none";
                //  imageID.src = "minus.png";
            } else {
                nestedGridView.style.display = "none";
                divText.style.display = "block";
                //imageID.src = "plus.png";
            }
        }
        

    </script>
   <script>
       $(document).ready(function () {
           $('a.topopup5').click(function () {
               $('#hdnlblCalification').val($(this).attr('val'));
           });

       });
       function myFunction(id, class2) {
           $('#spnCalificación-' + id).children().html(class2);
           $('#spnCalificación-' + id).children().removeClass();
           $('#spnCalificación-' + id).children().addClass(class2)
       }
    </script>
    <script>
        $(document).ready(function () {
            $('a.topopup6').click(function () {
                $('#hdnlblCalification').val($(this).attr('val'));
            });
        });
        function myFunction1(id1, class3) {
            $('#spnImportancia-' + id1).html(class3);
        }
    </script>
    <script>
        $(document).ready(function () {

            $('a.topopup').click(function () {
                $('#hdnID').val($(this).attr('val'));
                $('#txtSubject').val($(this).attr('subject'));
                $('#txtSentby').val($(this).attr('SentBy'));
                $('#txtEmailBody').val('Estimado Usuario,\n ha querido compartir este link con usted por favor presione debajo para acceder:')

            });
            $('a.topopup3').click(function () {
                $('#hdnShareVedioID').val($(this).attr('val'));
                $('#hdnSectionCode').val($(this).attr('sectioncode'));
                $('#hdnMediaTypeName').val($(this).attr('mediatypename'));
                $('#hdnImageAudioVideoName').val($(this).attr('ImageAudioVideoName'));
                $('#txtShareSubject').val($(this).attr('subject'));
                $('#txtShareSentBy').val($(this).attr('SentBy'));
                $('#txtShareEmailBody').val('Estimado Usuario,\n ha querido compartir este link con usted por favor presione debajo para acceder:')
            });
            $("a.topopup2").click(function () {
                $("#hdnComentID").val($(this).attr('val'));
                var ID = $(this).attr('val');
                var jsdata = '{IDN:' + ID + '}';
                $("#NamesGridView").html('');
                $.ajax({

                    type: "POST",

                    url: "all-newsalertLast.aspx/GetNames",

                    data: jsdata,

                    contentType: "application/json",
                    dataType: "json",
                    success: function (data) {
                        for (var i = 0; i < data.d.length; i++) {
                            $("#NamesGridView").append("<tr><td><span id='spnCommennts-" + data.d[i].ID + "'>" + data.d[i].Comments +
                                            "<span></td><td>User:" + data.d[i].FullName + "&nbsp;&nbsp;" + "/" + data.d[i].RFDate + "<span>&nbsp;&nbsp;" + data.d[i].time + "</span></td><td><a href='javascript:void(0);' class='aEdit' style='display:" + display(data.d[i].UserID, $('#hdnUserRole').val()) + ";' val='" + data.d[i].ID + "'>Edit/</a><a href='javascript:void(0);' class='aDelete' style='display:" + display(data.d[i].UserID, $('#hdnUserRole').val()) + ";' val='" + data.d[i].ID + "'>Delete</a></td></tr>");
                        }

                    }
                })

            });


            $('a.aDelete').live("click", function () {
                var ID = $(this).attr('val');
                var jsdata = '{id:' + ID + '}';
                $.ajax({

                    type: "POST",

                    url: "all-newsalertLast.aspx/delete",

                    data: jsdata,

                    contentType: "application/json",
                    dataType: "json",
                    success: function (data) {

                    }
                })
                $(this).closest("tr").hide();
            });
            $('a.aEdit').live("click", function () {

                $("#hdncomentEditID").val($(this).attr('val'));

                var comment = $('#spnCommennts-' + $(this).attr('val')).text()
                $('#txtComent').val(comment);
            });
            $("a.topopup4").click(function () {

                var ID = $(this).attr('val');
                var jsdata = '{ID:' + ID + '}';
                $("#lblMediaTypeName").html('');
                $("#lblMediaTypeName").html('');
                $("#lblRFDate").html('');
                $("#lblRFDate2").html('');
                $("#lblMediaName").html('');
                $("#lblSectionDescription").html('');
                $("#lblNews").html('');
                $("#lblCalification").html('');
                $("#lblImportant").html('');
                $.ajax({

                    type: "POST",

                    url: "all-newsalertLast.aspx/getNewsAlert",

                    data: jsdata,

                    contentType: "application/json",
                    dataType: "json",
                    success: function (data) {
                        for (var i = 0; i < data.d.length; i++) {
                            $("#lblMediaTypeName").html(data.d[i].MediaTypeName);
                            $("#lblMediaTypeName").html(data.d[i].Title);
                            $("#lblRFDate").html(data.d[i].RFDate);
                            $("#lblRFDate2").html(data.d[i].RFDate);
                            $("#lblMediaName").html(data.d[i].MediaName);
                            $("#lblSectionDescription").html(data.d[i].SectionDescription);
                            $("#lblNews").html(data.d[i].News);
                            $("#lblCalification").html(data.d[i].Calification);
                            $("#lblImportant").html(data.d[i].Important);
                            $('#aShareNews').attr("val", data.d[i].ID);
                            $('#aComments').attr("val", data.d[i].ID);
                            $('#aView').attr("val", data.d[i].ID);
                            $('#aView').attr("imagename", data.d[i].ImageAudioVideoName);
                            $('#aView').attr("MediaTypeName", data.d[i].MediaTypeName);
                            $('#aView').attr("SectionCode", data.d[i].SectionCode);
                            $('#ashareVideo').attr("val", data.d[i].ID);
                            $('#ashareVideo').attr("sectioncode", data.d[i].SectionCode);
                            $('#ashareVideo').attr("mediatypename", data.d[i].MediaTypeName);
                            $('#ashareVideo').attr("imageaudiovideoname", data.d[i].ImageAudioVideoName);
                            switch (data.d[i].MediaTypeName) {
                                case 'TV':
                                    $('#aView').attr("title", 'watch video');
                                    $('#ashareVideo').attr("title", 'Share Video');
                                    break;
                                case 'Radio':
                                    $('#aView').attr("title", 'Listen Audio');
                                    $('#ashareVideo').attr("title", 'Share Audio');
                                    break;
                                case 'Press':
                                    $('#aView').attr("title", 'View');
                                    $('#ashareVideo').attr("title", 'Share Image');
                                    break;
                                case 'Internet':
                                    $('#aView').attr("title", 'View');
                                    $('#ashareVideo').attr("title", 'Share Image');
                                    break;
                            }
                            $('#aComments').attr('title', 'Comments' + ' ' + data.d[i].Totalrecord);

                            //check comment count
                            var CommentCount = parseInt(data.d[i].Totalrecord);
                            if (CommentCount > 0) {
                                $("#AddImg").attr("src", "../images/chat-icon2.png");
                            }
                            else {
                                $("#AddImg").attr("src", "../images/chat-icon.jpg");
                            }
                            $('#aDownloadVideo').attr("val", data.d[i].ID);
                            $('#aDownloadVideo').attr("MediaTypeCode", data.d[i].MediaTypeName);
                        }
                    }
                })

            });
            $('#aDownloadVideo').click(function () {
                GetDownload($(this).attr('val'), $(this).attr('MediaTypeCode'));
                return false;

            });
            $('#aView').click(function () {
                popup($(this).attr('val'), $(this).attr('imagename'), $(this).attr('MediaTypeName'), $(this).attr('SectionCode'));
            });

            function popup(ID, Name, MediaType, SectionCode) {
                switch (MediaType) {
                    case "Internet":
                        PopupCenterWithScroll('../sitefiles/Internet.aspx?ID=' + ID + '&t=s&file=' + Name, '_blank', 750, 700);
                        break;
                    case "TV":
                        PopupCenter('../sitefiles/NewsAlertvideo.aspx?SectionCode=' + SectionCode + '&t=f&ID=' + ID, '_blank', 350, 280);
                        break;
                    case "Radio":
                        PopupCenter('../sitefiles/NewsAlertradio.aspx?SectionCode=' + SectionCode + '&t=f&ID=' + ID, '_blank', 350, 280);
                        break;
                    case "Press":
                        PopupCenterWithScroll('../sitefiles/NewsAlertpress.aspx?ID=' + ID + '&t=s&file=' + Name, '_blank', 750, 700);
                        break;
                }

            }
        });
    </script>
    <script>
        $("a.topopup").live('click', function () {
            $('#hdnID').val($(this).attr('val'));
            $('#txtSubject').val($(this).attr('subject'));
            $('#txtSentby').val($(this).attr('SentBy'));
            $('#txtEmailBody').val('Estimado Usuario,\n ha querido compartir este link con usted por favor presione debajo para acceder:')

        });
        $("a.topopup2").live('click', function () {
            $("#hdnComentID").val($(this).attr('val'));
            var ID = $(this).attr('val');
            var jsdata = '{IDN:' + ID + '}';
            $("#NamesGridView").html('');
            $.ajax({

                type: "POST",

                url: "all-newsalertLast.aspx/GetNames",

                data: jsdata,

                contentType: "application/json",
                dataType: "json",
                success: function (data) {
                    for (var i = 0; i < data.d.length; i++) {
                        $("#NamesGridView").append("<tr><td><span id='spnCommennts-" + data.d[i].ID + "'>" + data.d[i].Comments +
                                            "<span></td><td>User:" + data.d[i].FullName + "&nbsp;&nbsp;" + "/" + data.d[i].RFDate + "<span>&nbsp;&nbsp;" + data.d[i].time + "</span></td><td><a href='javascript:void(0);' class='aEdit' style='display:" + display(data.d[i].UserID, $('#hdnUserRole').val()) + ";' val='" + data.d[i].ID + "'>Edit/</a><a href='javascript:void(0);' class='aDelete' style='display:" + display(data.d[i].UserID, $('#hdnUserRole').val()) + ";' val='" + data.d[i].ID + "'>Delete</a></td></tr>");
                    }

                }
            })

        });
        $("a.topopup3").live('click', function () {
            $('#hdnShareVedioID').val($(this).attr('val'));
            $('#hdnSectionCode').val($(this).attr('sectioncode'));
            $('#hdnMediaTypeName').val($(this).attr('mediatypename'));
            $('#hdnImageAudioVideoName').val($(this).attr('ImageAudioVideoName'));
            $('#txtShareSubject').val($(this).attr('subject'));
            $('#txtShareSentBy').val($(this).attr('SentBy'));
            $('#txtShareEmailBody').val('Estimado Usuario,\n ha querido compartir este link con usted por favor presione debajo para acceder:')
        });
        $("a.topopup4").live('click', function () {
            var ID = $(this).attr('val');
            var jsdata = '{ID:' + ID + '}';
            $("#lblMediaTypeName").html('');
            $("#lblMediaTypeName").html('');
            $("#lblRFDate").html('');
            $("#lblRFDate2").html('');
            $("#lblMediaName").html('');
            $("#lblSectionDescription").html('');
            $("#lblNews").html('');
            $("#lblCalification").html('');
            $("#lblImportant").html('');
            $.ajax({

                type: "POST",

                url: "all-newsalertLast.aspx/getNewsAlert",

                data: jsdata,

                contentType: "application/json",
                dataType: "json",
                success: function (data) {
                    for (var i = 0; i < data.d.length; i++) {
                        $("#lblMediaTypeName").html(data.d[i].MediaTypeName);
                        $("#lblMediaTypeName").html(data.d[i].Title);
                        $("#lblRFDate").html(data.d[i].RFDate);
                        $("#lblRFDate2").html(data.d[i].RFDate);
                        $("#lblMediaName").html(data.d[i].MediaName);
                        $("#lblSectionDescription").html(data.d[i].SectionDescription);
                        $("#lblNews").html(data.d[i].News);
                        $("#lblCalification").html(data.d[i].Calification);
                        $("#lblImportant").html(data.d[i].Important);
                        $('#aShareNews').attr("val", data.d[i].ID);
                        $('#aComments').attr("val", data.d[i].ID);
                        $('#aView').attr("val", data.d[i].ID);
                        $('#aView').attr("imagename", data.d[i].ImageAudioVideoName);
                        $('#aView').attr("MediaTypeName", data.d[i].MediaTypeName);
                        $('#aView').attr("SectionCode", data.d[i].SectionCode);
                        $('#ashareVideo').attr("val", data.d[i].ID);
                        $('#ashareVideo').attr("sectioncode", data.d[i].SectionCode);
                        $('#ashareVideo').attr("mediatypename", data.d[i].MediaTypeName);
                        $('#ashareVideo').attr("imageaudiovideoname", data.d[i].ImageAudioVideoName);
                        switch (data.d[i].MediaTypeName) {
                            case 'TV':
                                $('#aView').attr("title", 'watch video');
                                $('#ashareVideo').attr("title", 'Share Video');
                                break;
                            case 'Radio':
                                $('#aView').attr("title", 'Listen Audio');
                                $('#ashareVideo').attr("title", 'Share Audio');
                                break;
                            case 'Press':
                                $('#aView').attr("title", 'View');
                                $('#ashareVideo').attr("title", 'Share Image');
                                break;
                            case 'Internet':
                                $('#aView').attr("title", 'View');
                                $('#ashareVideo').attr("title", 'Share Image');
                                break;
                        }
                        $('#aComments').attr('title', 'Comments' + ' ' + data.d[i].Totalrecord);

                        //check comment count
                        var CommentCount = parseInt(data.d[i].Totalrecord);
                        if (CommentCount > 0) {
                            $("#AddImg").attr("src", "../images/chat-icon2.png");
                        }
                        else {
                            $("#AddImg").attr("src", "../images/chat-icon.jpg");
                        }
                    }
                }
            })

        });
           
        
    </script>
    <script type="text/javascript">
        $(document).ready(function () {
            SearchText();
        });
        function SearchText() {
            $(".autosuggest").autocomplete({
                source: function (request, response) {
                    $.ajax({
                        type: "POST",
                        contentType: "application/json; charset=utf-8",
                        url: "../AutoCompleteService.asmx/GetAutoCompleteData",
                        data: "{'username':'" + document.getElementById('txtSendEmail').value + "'}",
                        dataType: "json",
                        success: function (data) {
                            response(data.d);

                        },

                        error: function (result) {
                            alert("Error");
                        }

                    });
                }
            });
        }
    </script>
    <script type="text/javascript">
        $(document).ready(function () {
            SearchText1();
        });
        function SearchText1() {
            $(".auto").autocomplete({
                source: function (request, response) {
                    $.ajax({
                        type: "POST",
                        contentType: "application/json; charset=utf-8",
                        url: "../AutoCompleteService.asmx/GetAutoCompleteData",
                        data: "{'username':'" + document.getElementById('txtEmailForShareVideo').value + "'}",
                        dataType: "json",
                        success: function (data) {
                            response(data.d);

                        },

                        error: function (result) {
                            alert("Error");
                        }

                    });
                }
            });
        }
    </script>
</asp:Content>
